import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String[] line1b = line1.split(" ");
		int n = Integer.parseInt(line1b[0]);
		int m = Integer.parseInt(line1b[1]);

		String[] all = new String[n + m];

		int[] mm = new int[m];

		for (int i = 0; i < n + m; i++) {
			all[i] = sc.nextLine();
			if (i >= n) {
				mm[i - n] = Integer.parseInt(all[i]);
			}
		}

		int[] nn = new int[m];

		for (int i = 0; i < n; i++) {
			String[] kari = all[i].split(" ");
			int sum = 0;
			for (int j = 0; j < m; j++) {
				nn[j] = Integer.parseInt(kari[j]);
				sum += nn[j] * mm[j];
			}
			System.out.println(sum);
		}
	}

}
/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