n,m = gets.split.map(&:to_i)
a = Array.new(n) { gets.split.map(&:to_i) }
b = Array.new(m) { gets.to_i }

result = 0

n.times do |i|
  m.times do |j|
    result += a[i][j] * b[j]
  end
  puts result
  result = 0
end