n,m = gets.chomp.split(" ").map(&:to_i)
temp = Array.new
mul = Array.new
ans = Array.new(n, 0)

n.times do
	str = gets.chomp.split(" ").map(&:to_i)
	temp.push(str)
end

m.times do
	str = gets.chomp.to_i
	mul.push(str)
end

for i in 0...n do
	for j in 0...m do
		ans[i] += temp[i][j] * mul[j]
	end
end

puts ans.join("\n")