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

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        }
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        }
    }

} Main public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        }
    } main {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        }
    } boolean first=true; first true try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        } {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line; line int i=0 i 0 n=0 n 0 m=0; m 0 int[][] card=null; card null int[] mat=null; mat null while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            } if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	} first {
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	} String[] str=line.split(" "); str line.split(" ") line.split line " " n=Integer.parseInt(str[0]) n Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 m=Integer.parseInt(str[1]) m Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 card=new int[n][m] card new int[n][m] n m mat=new int[m] mat new int[m] m first=false first false {
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	} if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		} i<n i n {
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		} String[] str=line.split(" "); str line.split(" ") line.split line " " for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		} int j=0; int j=0; j 0 j<m j m j++ j++ j {
            			card[i][j]=Integer.parseInt(str[j]);
            		} {
            			card[i][j]=Integer.parseInt(str[j]);
            		} card[i][j]=Integer.parseInt(str[j]) card[i][j] card[i] card i j Integer.parseInt(str[j]) Integer.parseInt Integer str[j] str j i++ i {
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		} mat[i-n]=Integer.parseInt(line) mat[i-n] mat i-n i n Integer.parseInt(line) Integer.parseInt Integer line i++ i if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		} i==n+m i n+m n m {
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		} for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			} int j=0; int j=0; j 0 j<n j n j++ j++ j {
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			} {
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			} int sum=0; sum 0 for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				} int l=0; int l=0; l 0 l<m l m l++ l++ l {
	            					sum+=(mat[l]*card[j][l]);
	            				} {
	            					sum+=(mat[l]*card[j][l]);
	            				} sum+=(mat[l]*card[j][l]) sum (mat[l]*card[j][l]) mat[l] mat l card[j][l] card[j] card j l System.out.println(sum) System.out.println System.out System System.out sum break; String[] args args public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        }
    }

} public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        }
    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        boolean first=true;
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line;
            int i=0,n=0,m=0;
            int[][] card=null;
            int[] mat=null;
            while ((line = br.readLine()) != null) {
            	if(first){
            		String[] str=line.split(" ");
            		n=Integer.parseInt(str[0]);
            		m=Integer.parseInt(str[1]);
            		card=new int[n][m];
            		mat=new int[m];
            		first=false;
            	}else{
            		if(i<n){
            		String[] str=line.split(" ");
            		for(int j=0;j<m;j++){
            			card[i][j]=Integer.parseInt(str[j]);
            		}
            		i++;
            		}else{
            			mat[i-n]=Integer.parseInt(line);
            			i++;
	            		if(i==n+m){
	            			for(int j=0;j<n;j++){
	            				int sum=0;
	            				for(int l=0;l<m;l++){
	            					sum+=(mat[l]*card[j][l]);
	            				}
	            				System.out.println(sum);
	            			}
	            			break;
	            		}
            		}
            	}
            }
        }
    }

}