function sum(a, b) {return a + b;}
function multi(a, b) {return a * b;}
function zip(a, b) {
    var z = [];
    for (var i = 0; i < a.length; ++i) {
        z.push([a[i], b[i]]);
    }
    return z;
}

const chunk = require('fs').readFileSync('/dev/stdin', 'utf8');
var lines = chunk.trim().split('\n');
const nm = lines.shift().split(' ').map(Number);

const a = lines.slice(0, nm[0]).map(
    function(ai){
        return ai.split(' ').map(Number);
    }
);

const b = lines.slice(nm[0]).map(Number);

const c = a.map(function(ai){
    return zip(ai, b).map(function(aijbi){
        return aijbi.reduce(multi);
    }).reduce(sum);
});

console.log(c.join('\n'));