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);
		}
	}

} import java.util.Scanner; Scanner java.util 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);
		}
	}

} 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);
		}
	} main {
		// 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);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line1 = sc.nextLine(); line1 sc.nextLine() sc.nextLine sc String[] line1b = line1.split(" "); line1b line1.split(" ") line1.split line1 " " int n = Integer.parseInt(line1b[0]); n Integer.parseInt(line1b[0]) Integer.parseInt Integer line1b[0] line1b 0 int m = Integer.parseInt(line1b[1]); m Integer.parseInt(line1b[1]) Integer.parseInt Integer line1b[1] line1b 1 String[] all = new String[n + m]; all new String[n + m] n + m n m int[] mm = new int[m]; mm new int[m] m for (int i = 0; i < n + m; i++) {
			all[i] = sc.nextLine();
			if (i >= n) {
				mm[i - n] = Integer.parseInt(all[i]);
			}
		} int i = 0; int i = 0; i 0 i < n + m i n + m n m i++ i++ i {
			all[i] = sc.nextLine();
			if (i >= n) {
				mm[i - n] = Integer.parseInt(all[i]);
			}
		} {
			all[i] = sc.nextLine();
			if (i >= n) {
				mm[i - n] = Integer.parseInt(all[i]);
			}
		} all[i] = sc.nextLine() all[i] all i sc.nextLine() sc.nextLine sc if (i >= n) {
				mm[i - n] = Integer.parseInt(all[i]);
			} i >= n i n {
				mm[i - n] = Integer.parseInt(all[i]);
			} mm[i - n] = Integer.parseInt(all[i]) mm[i - n] mm i - n i n Integer.parseInt(all[i]) Integer.parseInt Integer all[i] all i int[] nn = new int[m]; nn new int[m] 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);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ 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);
		} {
			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);
		} String[] kari = all[i].split(" "); kari all[i].split(" ") all[i].split all[i] all i " " int sum = 0; sum 0 for (int j = 0; j < m; j++) {
				nn[j] = Integer.parseInt(kari[j]);
				sum += nn[j] * mm[j];
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				nn[j] = Integer.parseInt(kari[j]);
				sum += nn[j] * mm[j];
			} {
				nn[j] = Integer.parseInt(kari[j]);
				sum += nn[j] * mm[j];
			} nn[j] = Integer.parseInt(kari[j]) nn[j] nn j Integer.parseInt(kari[j]) Integer.parseInt Integer kari[j] kari j sum += nn[j] * mm[j] sum nn[j] * mm[j] nn[j] nn j mm[j] mm j System.out.println(sum) System.out.println System.out System System.out sum String[] args args 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);
		}
	}

} 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);
		}
	}

} Main
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);
		}
	}

}