n, m = gets.chomp.split.map(&:to_i)
a = []
b = []

n.times { a.push gets.chomp.split.map(&:to_i) }
m.times { b.push gets.chomp.to_i }

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

