n, m = gets.split.map(&:to_i)
mat = []
(1..n).each do |_x|
  mat << gets.split.map(&:to_i)
end
v = []
(1..m).each do |_x|
  v << gets.to_i
end

ans = [0] * n
(0...n).each do |x|
  (0...m).each do |y|
    ans[x] += mat[x][y] * v[y]
  end
end
puts ans.join("\n") + "\n"