import std.algorithm, std.array, std.container, std.range, std.bitmanip;
import std.numeric, std.math, std.bigint, std.random, core.bitop;
import std.string, std.regex, std.conv, std.stdio, std.typecons;

void main()
{
  auto rd = readln.split.map!(to!size_t);
  auto n = rd[0], m = rd[1];
  auto aij = iota(n).map!(_ => readln.split.map!(to!int)).array;
  auto bi = iota(m).map!(_ => readln.chomp.to!int).array;

  auto ci = new int[](n);
  foreach (i; 0..n)
    ci[i] = iota(m).map!(j => aij[i][j] * bi[j]).sum;

  ci.each!(writeln);
}