q = []
w = []
m, n = gets.split(" ").map(&:to_i)

m.times do
  q.push(gets.split(" ").map(&:to_i))
end

n.times do
  w.push(gets.to_i)
end

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

