import std.stdio, std.string, std.array, std.conv;

void main () {
    int[] tmp = readln.chomp.split.to!(int[]);
    int n = tmp[0], m = tmp[1];
    int[][] a = new int[][](n, m);
    foreach (i; 0 .. n) {
        int[] row = readln.chomp.split.to!(int[]);
        foreach (j; 0 .. m) {
            a[i][j] = row[j];
        }
    }
    int[] b = new int[m];
    foreach (j; 0 .. m) {
        b[j] = readln.chomp.to!int;
    }
    int[] c = new int[n];
    foreach (i; 0 .. n) {
        foreach (j; 0 .. m) {
            c[i] += a[i][j] * b[j];
        }
    }
    foreach (x; c) x.writeln;
}
