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

a = Array.new(n)
b = Array.new(m)

n.times do
a << gets.chomp.split.map(&:to_i)
end

m.times do
b << gets.to_i
end

sum = 0

for i in 1..n
sum = 0
for j in 1..m
 s +=a[i-1][j-1] * b[j-1]
end 
puts s
end
