import java.util.Scanner;


public class Main {

	public static void main(String [] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int m = sc.nextInt();
		
		int[][] A = new int[n][m];
		
		for(int i = 0;i < n;i++) {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		}
		
		int[] B = new int[m];
		
		for(int k = 0;k < m;k++) {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		}
		
		//Aは要素Aの配列、Bは要素Bの配列
		
		int sum = 0;
		int seki;
		
		for(int x = 0;x < n;x++) {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		}
		
		
		
		
		
		
		
		}



}
 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String [] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int m = sc.nextInt();
		
		int[][] A = new int[n][m];
		
		for(int i = 0;i < n;i++) {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		}
		
		int[] B = new int[m];
		
		for(int k = 0;k < m;k++) {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		}
		
		//Aは要素Aの配列、Bは要素Bの配列
		
		int sum = 0;
		int seki;
		
		for(int x = 0;x < n;x++) {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		}
		
		
		
		
		
		
		
		}



} Main public static void main(String [] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int m = sc.nextInt();
		
		int[][] A = new int[n][m];
		
		for(int i = 0;i < n;i++) {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		}
		
		int[] B = new int[m];
		
		for(int k = 0;k < m;k++) {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		}
		
		//Aは要素Aの配列、Bは要素Bの配列
		
		int sum = 0;
		int seki;
		
		for(int x = 0;x < n;x++) {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		}
		
		
		
		
		
		
		
		} main {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int m = sc.nextInt();
		
		int[][] A = new int[n][m];
		
		for(int i = 0;i < n;i++) {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		}
		
		int[] B = new int[m];
		
		for(int k = 0;k < m;k++) {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		}
		
		//Aは要素Aの配列、Bは要素Bの配列
		
		int sum = 0;
		int seki;
		
		for(int x = 0;x < n;x++) {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		}
		
		
		
		
		
		
		
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int[][] A = new int[n][m]; A new int[n][m] n m for(int i = 0;i < n;i++) {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		} {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		} for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			} {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc A[i][j] = a A[i][j] A[i] A i j a int[] B = new int[m]; B new int[m] m for(int k = 0;k < m;k++) {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		} int k = 0; int k = 0; k 0 k < m k m k++ k++ k {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		} {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		} int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc B[k] = b B[k] B k b int sum = 0; sum 0 int seki; seki for(int x = 0;x < n;x++) {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		} int x = 0; int x = 0; x 0 x < n x n x++ x++ x {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		} {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		} sum = 0 sum 0 for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			} int y = 0; int y = 0; y 0 y < m y m y++ y++ y {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			} {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			} seki = A[x][y] * B[y] seki A[x][y] * B[y] A[x][y] A[x] A x y B[y] B y sum = sum + seki sum sum + seki sum seki 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) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int m = sc.nextInt();
		
		int[][] A = new int[n][m];
		
		for(int i = 0;i < n;i++) {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		}
		
		int[] B = new int[m];
		
		for(int k = 0;k < m;k++) {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		}
		
		//Aは要素Aの配列、Bは要素Bの配列
		
		int sum = 0;
		int seki;
		
		for(int x = 0;x < n;x++) {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		}
		
		
		
		
		
		
		
		}



} public class Main {

	public static void main(String [] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int m = sc.nextInt();
		
		int[][] A = new int[n][m];
		
		for(int i = 0;i < n;i++) {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		}
		
		int[] B = new int[m];
		
		for(int k = 0;k < m;k++) {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		}
		
		//Aは要素Aの配列、Bは要素Bの配列
		
		int sum = 0;
		int seki;
		
		for(int x = 0;x < n;x++) {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		}
		
		
		
		
		
		
		
		}



} Main
import java.util.Scanner;


public class Main {

	public static void main(String [] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		int m = sc.nextInt();
		
		int[][] A = new int[n][m];
		
		for(int i = 0;i < n;i++) {
			for(int j = 0;j < m;j++) {
				
				int a = sc.nextInt();
				
				
				A[i][j] = a;
				
						
						
			}
		}
		
		int[] B = new int[m];
		
		for(int k = 0;k < m;k++) {
			
			int b = sc.nextInt();
			
			
			B[k] = b;
			
			
		}
		
		//Aは要素Aの配列、Bは要素Bの配列
		
		int sum = 0;
		int seki;
		
		for(int x = 0;x < n;x++) {
			sum = 0;
			
			
			for(int y = 0;y < m;y++) {
				
				
				
				
				seki = A[x][y] * B[y];
				sum = sum + seki;
				
				
			}
			
			System.out.println(sum);
		}
		
		
		
		
		
		
		
		}



}

