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

matrix_a = Array.new(n).map{Array.new(m,0)}

for i in 0..n-1 do
	matrix_a[i] = gets.split(" ").map(&:to_i)
end

matrix_b = []

for i in 0..m-1 do	
	matrix_b[i] = gets.to_i
end

for i in 0..n-1 do
    sum = 0
	for j in 0..m-1 do
		sum += matrix_a[i][j] * matrix_b[j] 
	end
	puts sum
end