const input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/);
let [a, b] = input[0].split(' ').map(Number);
let bmat = [];
 for (let j = a + 1; j <= (a+b); j++) {
    bmat.push(Number(input[j]));
 }
 
 for (let i = 1; i <= a; i++) {
     let tmp = [];
     let matrix = input[i].split(' ').map(Number);
     for (let j = 0; j < b; j++) {
        tmp.push(matrix[j] * bmat[j]);
     }
    sum = tmp.reduce((a,x) => a+=x,0);
     console.log(sum);
 }
     
