let () =
  let n, m = Scanf.scanf "%d %d\n" (fun x y -> x, y) in
  let a = Array.make_matrix n m 0 in
  let b = Array.make m 0 in
  let c = Array.make n 0 in
  for i = 0 to (n-1) do
    for j = 0 to (m-1) do
      a.(i).(j) <- Scanf.scanf "%d " (fun x -> x)
    done
  done;
  
  for i = 0 to (m-1) do
    b.(i) <- Scanf.scanf "%d\n" (fun x -> x)
  done;

  for i = 0 to (n-1) do
    for j = 0 to (m-1) do
      c.(i) <- c.(i) + a.(i).(j) * b.(j)
    done
  done;

  for i = 0 to (n-1) do
    Printf.printf "%d\n" c.(i)
  done ;;
