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++) {
	sum = 0;
	for (j = 0; j < m; j++) {
		ai = line[i+1].split(' ').map(Number);
		sum += ai[j] * b[j];
	}
	console.log(sum);
}