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

void main()
{
    auto n = map!(to!int)(readln.strip.split);
    int[100][100] v1;
    int[100] v2;

    foreach(i;0..n[0])
      foreach(int j,string e; readln.strip.split)
        v1[i][j] = e.to!int;

    foreach(i;0..n[1])
      v2[i] = readln.strip.to!int;

    foreach(i;0..n[0]) {
        int sum = 0;
        foreach(j;0..n[1]) {
            sum += v1[i][j] * v2[j];
        }
        writeln(sum);
    }
}