import java.io.*;

class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] line = br.readLine().split(" ");
			int a1 = Integer.parseInt(line[0]);
			int a2 = Integer.parseInt(line[1]);
			int[][] n = new int [a1][a2];
			int[] b = new int[a2];

			
			for(int i = 0;i < a1;i++){
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			}
			
			for(int i = 0;i < a2;i++){
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			}
			
			for(int i = 0;i < a1;i++){
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			}
		} catch(Exception e){
		}
	}
}
				 
			 import java.io.*; io.* java class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] line = br.readLine().split(" ");
			int a1 = Integer.parseInt(line[0]);
			int a2 = Integer.parseInt(line[1]);
			int[][] n = new int [a1][a2];
			int[] b = new int[a2];

			
			for(int i = 0;i < a1;i++){
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			}
			
			for(int i = 0;i < a2;i++){
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			}
			
			for(int i = 0;i < a1;i++){
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			}
		} catch(Exception e){
		}
	}
} Main public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] line = br.readLine().split(" ");
			int a1 = Integer.parseInt(line[0]);
			int a2 = Integer.parseInt(line[1]);
			int[][] n = new int [a1][a2];
			int[] b = new int[a2];

			
			for(int i = 0;i < a1;i++){
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			}
			
			for(int i = 0;i < a2;i++){
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			}
			
			for(int i = 0;i < a1;i++){
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			}
		} catch(Exception e){
		}
	} main {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] line = br.readLine().split(" ");
			int a1 = Integer.parseInt(line[0]);
			int a2 = Integer.parseInt(line[1]);
			int[][] n = new int [a1][a2];
			int[] b = new int[a2];

			
			for(int i = 0;i < a1;i++){
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			}
			
			for(int i = 0;i < a2;i++){
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			}
			
			for(int i = 0;i < a1;i++){
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			}
		} catch(Exception e){
		}
	} try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] line = br.readLine().split(" ");
			int a1 = Integer.parseInt(line[0]);
			int a2 = Integer.parseInt(line[1]);
			int[][] n = new int [a1][a2];
			int[] b = new int[a2];

			
			for(int i = 0;i < a1;i++){
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			}
			
			for(int i = 0;i < a2;i++){
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			}
			
			for(int i = 0;i < a1;i++){
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			}
		} catch(Exception e){
		} catch(Exception e){
		} Exception e {
		} {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] line = br.readLine().split(" ");
			int a1 = Integer.parseInt(line[0]);
			int a2 = Integer.parseInt(line[1]);
			int[][] n = new int [a1][a2];
			int[] b = new int[a2];

			
			for(int i = 0;i < a1;i++){
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			}
			
			for(int i = 0;i < a2;i++){
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			}
			
			for(int i = 0;i < a1;i++){
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			}
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a1 = Integer.parseInt(line[0]); a1 Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int a2 = Integer.parseInt(line[1]); a2 Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 int[][] n = new int [a1][a2]; n new int [a1][a2] a1 a2 int[] b = new int[a2]; b new int[a2] a2 for(int i = 0;i < a1;i++){
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			} int i = 0; int i = 0; i 0 i < a1 i a1 i++ i++ i {
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			} {
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			} String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				} int j = 0; int j = 0; j 0 j < a2 j a2 j++ j++ j {
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				} {
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				} int f = Integer.parseInt(str[j]); f Integer.parseInt(str[j]) Integer.parseInt Integer str[j] str j n[i][j] += f n[i][j] n[i] n i j f for(int i = 0;i < a2;i++){
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			} int i = 0; int i = 0; i 0 i < a2 i a2 i++ i++ i {
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			} {
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			} int f = Integer.parseInt(br.readLine()); f Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br b[i] += f b[i] b i f for(int i = 0;i < a1;i++){
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			} int i = 0; int i = 0; i 0 i < a1 i a1 i++ i++ i {
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			} {
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			} int matrix = 0; matrix 0 for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				} int j = 0; int j = 0; j 0 j < a2 j a2 j++ j++ j {
				matrix += n[i][j]*b[j];
				} {
				matrix += n[i][j]*b[j];
				} matrix += n[i][j]*b[j] matrix n[i][j]*b[j] n[i][j] n[i] n i j b[j] b j System.out.println(matrix) System.out.println System.out System System.out matrix String[] args args
import java.io.*;

class Main {
	public static void main(String[] args){
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String[] line = br.readLine().split(" ");
			int a1 = Integer.parseInt(line[0]);
			int a2 = Integer.parseInt(line[1]);
			int[][] n = new int [a1][a2];
			int[] b = new int[a2];

			
			for(int i = 0;i < a1;i++){
				String[] str = br.readLine().split(" ");
				for(int j = 0;j < a2;j++){
					int f = Integer.parseInt(str[j]);
					n[i][j] += f;
				}
			}
			
			for(int i = 0;i < a2;i++){
				int f = Integer.parseInt(br.readLine());
				b[i] += f;
			}
			
			for(int i = 0;i < a1;i++){
				int matrix = 0;
				for(int j = 0;j < a2;j++){
				matrix += n[i][j]*b[j];
				}
			System.out.println(matrix);	
			}
		} catch(Exception e){
		}
	}
}
				 
			