"use strict";
process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = []
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});

reader.on('line', (line) => {
  lines.push(line);
});

var re = /\s+|$/;
reader.on('close', () => {
    console.log(aux(lines));
});

function aux(lines)
{
    var m, n;
    var mat = [];
    var b = [];
    var l = 0;
    //console.log('lines: ', lines.join('\n'));
    [m, n] = lines[l++].trim().split(' ').map(Number);
    //console.log('m,n: ', m, n);
    for (var i=0; i<m; i++) {
	mat[i] = new Array(n);
    }
    for (var i=0; i<m; i++) {
	var ln = lines[l++].trim().split(' ').map(Number);
	mat[i] = ln;
    }
    b = new Array(n);

    //console.log('mat: ');
/*
    for (var i=0; i<m; i++) {
	console.log(mat[i].map(String).join(' '));
    }
*/
    for (var j=0; j<n; j++) {
	//console.log('j: ', j, 'lines[j]: ', lines[l]);
	b[j]  = Number(lines[l++]);
    }
    //console.log('b: ', b.map(String).join(' '));

    var c = new Array(m);
    for (var i=0; i<m; i++) {
	var s = 0;
	for (var j=0; j<n; j++) {
	    s += mat[i][j]*b[j];
	}
	//console.log('s: ', s);
	c[i] = s;
	
    }
    //console.log('c: ', c);

    return(c.map(String).join('\n'));
}
