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

a = Array.new(n)

n.times do |i|
	a[i] = gets.split.map(&:to_i)
end

b = Array.new(m)

m.times do |i|
	b[i] = gets.to_i
end

a.each do |line|
	ans = 0
	line.length.times do |i|
		ans  += line[i] * b[i]
	end
	puts ans
end