def read_inputs
  n, m = gets.split(" ").map(&:to_i)
  matrix_a = (1..n).map{gets.split(" ").map(&:to_i)}
  matrix_b = (1..m).map{gets.to_i}
  return matrix_a, matrix_b
end

matrix_a, matrix_b = read_inputs

puts matrix_a.map {|a|
  a.zip(matrix_b).map {|x| x.first * x.last}.inject(:+)
}.join("\n")