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

void main() {
	int n, m;
	"%d %d\n".readf(&n, &m);
	int[][] a;
	int[] b;
	foreach (_n; 0..n) a ~= readln.split.to!(int[]);
	foreach (_m; 0..m) b ~= readln.split[0].to!int;
	foreach (_a; a) {
		long s = 0L;
		foreach (i; 0..m) s += _a[i] * b[i];
		s.writeln;
	}
}