inputs = gets.strip().split(" ").map{|i| i.to_i}
n = inputs[0]
m = inputs[1]
a = Array.new(n){Array.new(m)}
b = Array.new(m)
c = Array.new(n){0}
for i in 0..n-1
	rows = gets.strip().split(" ").map{|x| x.to_i}
	a[i][0..m-1] = rows
end
for i in 0..m-1
	row = gets.strip.to_i
	b[i] = row
end
for i in 0..n-1
	for j in 0..m-1
		c[i] += a[i][j] * b[j]
	end
	puts c[i]
end
