n, m = gets.split.map(&:to_i)

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

n.times do |i|
  a[i] = gets.split.map(&:to_i)
end

m.times do |i|
  b[i] = gets.to_i
end

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