def array_integer(a)
	0.upto(a.count) {|x|
		a[x] = a[x].to_i
	}
	return a
end

n,m = array_integer(STDIN.gets.split(" "))

matrix = Array.new(n).map{Array.new(m)}
vector = Array.new(m)
multiple = Array.new(n, 0)

0.upto(n-1) {|i|
	matrix[i] = array_integer(STDIN.gets.split(" "))
}

0.upto(m-1) {|j|
	vector[j] = STDIN.gets.to_i
}

0.upto(n-1) {|i|
	0.upto(m-1) {|j|
		multiple[i] += matrix[i][j] * vector[j]
	}
	print multiple[i], "\n"
}

