n, m = $stdin.readline.split(" ").map {|s| s.to_i }

a = Array.new(n) { Array.new(m, 0) }

(0..n-1).each do |i|
  nums = $stdin.readline.split(" ").map {|s| s.to_i }
  nums.each_with_index do |a_i_j, j|
    a[i][j] = a_i_j
  end
end

b = []
(1..m).each do |i|
  b.push($stdin.readline.to_i)
end

c = Array.new(n)
(0..n-1).each do |i|
  sum = 0
  (0..m-1).each do |j|
    sum += a[i][j] * b[j]
  end
  c[i] = sum
end

puts c

