# ITP1_6_D_0001.rb
a = Array.new
b = Array.new


n,m = gets.split.map(&:to_i)
n.times do
	a_buff = Array.new
	a_buff = gets.split.map(&:to_i)
	a << a_buff
end

m.times do
	b << gets.to_i
end

c = Array.new(n, 0)

n.times do |n1|
	m.times do |m1|
		c[n1] += a[n1][m1] * b[m1]
	end
end

puts c.join("\n")