n, m = gets.split.map(&:to_i)
a = Array.new(n)
b = Array.new(m)
for i in 0..n-1 do
	a[i] = gets.split.map(&:to_i)
end
for i in 0..m-1 do
	b[i] = gets.to_i
end
c = Array.new(n, 0)
for i in 0..n-1 do
	for j in 0..m-1 do
		c[i] += a[i][j] * b[j]
	end
	puts c[i]
end