imput_1 = gets.chomp.split("\s")
n, m = imput_1[0].to_i, imput_1[1].to_i

# m行n列の行列A
determinant_A = Array.new(n){ Array.new(m)}

for i in 0..n - 1
	imput_2 = gets.chomp.split("\s")
	
	# 文字列のinteger化と代入
	for j in 0..m - 1
		determinant_A[i][j] = imput_2[j].to_i
	end
end

# m行1列の行列B
determinant_B = Array.new(m)

# 文字列のinteger化と代入
for k in 0..m - 1
	determinant_B[k] = gets.chomp.to_i
end

# 行列の計算
for q in 0..n - 1
	
	# sumは行ごとにリセット
	sum = 0
	
	# 要素の計算
	for r in 0..m - 1
		sum += determinant_A[q][r] * determinant_B[r]
	end
	puts sum
end