let split str delim =
  let rec doit s acc =
    match
      try Some (String.index s delim)
      with _ -> None
    with
    | None -> s :: acc
    | Some i ->
        let s1 = String.sub s 0 i in
        let s2 = String.sub s (i + 1) (String.length s - String.length s1 - 1) in
        doit s2 (s1 :: acc)
  in
  List.rev (doit str [])

let () =
  let l = read_line () in
  match List.map int_of_string (split l ' ') with
  | [] | [_] -> exit 1
  | n :: m :: _ ->
      let a = Array.make (n * m) 0 in
      let b = Array.make m 0 in
      for i = 1 to n do
        let l = read_line () in
        let ls = Array.of_list (List.map int_of_string (split l ' ')) in
        for j = 1 to m do
          a.(m*(i-1) + (j-1)) <- ls.(j-1)
        done
      done;
      for i = 1 to m do
        let x = read_int () in
        b.(i-1) <- x
      done;
      for i = 1 to n do
        let c = ref 0 in
        for j = 1 to m do
          c := !c + a.(m*(i-1) + (j-1)) * b.(j-1)
        done;
        Printf.printf "%d\n" !c
      done