function main(input){
    let lines = input.split("\n");
    let aArgs = lines.shift().split(" ").map(x => parseInt(x));
    let n = aArgs[0];
    let m = aArgs[1];
    let aLines = lines.slice(0,n);
    let bLines = lines.slice(n).map(x=>parseInt(x));
    
    for(let i=0;i<n;i++){
        let elm = 0;
        let aLine = aLines[i].split(" ");
        for(let j=0;j<m;j++){
            elm += bLines[j]*parseInt(aLine[j]);
        }
        console.log(elm);
    }


}



main(require("fs").readFileSync("/dev/stdin","utf-8"));
