'use strict'

const main = arg => {
    const input = arg.trim().split("\n");
    const matrixNum = input[0].split(" ").map(str => parseInt(str, 10));
    const a = input.slice(1).slice(0, matrixNum[0]);
    const b = input.slice(1).slice(matrixNum[0], input.length).map(str => parseInt(str, 10));
    const result = [];

    a.forEach((matrix, i) => {
        const m = matrix.split(" ").slice(0, matrixNum[1]).map(str => parseInt(str, 10));
        var sum = 0;

        m.forEach((a, j) => { sum += a * b[j]  });
        result.push(sum);
    });

    console.log(result.join("\n"));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
