import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
			String a = reader.readLine();
			String[] b = a.split(" ");
			int c = Integer.parseInt(b[0]);
			int d = Integer.parseInt(b[1]);
			String[] e = new String[d];
			int[][] f = new int[c][d];
			for (int g = 0; g < c; g++) {
				a = reader.readLine();
				e = a.split(" ");
				for (int h = 0; h < d; h++) {
					f[g][h] = Integer.parseInt(e[h]);
				}
			}
			
			int[] i = new int[d];
			for (int j = 0; j < d; j++) {
				a = reader.readLine();
				i[j] = Integer.parseInt(a);
			}
			int k = 0;
			for (int l = 0; l < c; l++) {
				for (int m = 0; m < d; m++) {
					k += f[l][m] * i[m];
				}
				System.out.println(k);
				k = 0;
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz