a = []
b = []

n, m = gets.split.map(&:to_i)
n.times do
  a.push(gets.split.map(&:to_i))
end

m.times do
  b.push(gets.to_i)
end

a.each do |row|
  puts row.zip(b).inject(0) { |sum, ab| sum + ab[0] * ab[1] }
end