line = require('fs').readFileSync('/dev/stdin', 'ascii').split('\n');
line[0] = line[0].split(' ').map(Number);
n = line[0][0];
m = line[0][1];
b = line.slice(n+1, n+m+1).map(Number);

for (i = 0; i < n; i++) {
	ai = line[i+1].split(' ').map(Number);
	console.log(inner_product(m, ai, b));
}

function inner_product(m, a, b) {
	var sum = 0, i;
	for (i = 0; i < m; i++)
		sum += a[i] * b[i];
	return sum;
}