import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
                    
                    String[] temp = str.split("\\s");
                    
                    int r = Integer.parseInt(temp[0]);
                    int c = Integer.parseInt(temp[1]);
                    int[][] inp = new int[r][c];
                    
                    

                    for(int i=0;i<r;i++){
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    }

                    
                    int[] ve = new int[c];
                    for(int k=0; k<c ; k++){
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    }
                    
                    for(int i=0;i<r;i++){
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    }
                        br.close();
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
                    
                    String[] temp = str.split("\\s");
                    
                    int r = Integer.parseInt(temp[0]);
                    int c = Integer.parseInt(temp[1]);
                    int[][] inp = new int[r][c];
                    
                    

                    for(int i=0;i<r;i++){
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    }

                    
                    int[] ve = new int[c];
                    for(int k=0; k<c ; k++){
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    }
                    
                    for(int i=0;i<r;i++){
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    }
                        br.close();
    }
} Main public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
                    
                    String[] temp = str.split("\\s");
                    
                    int r = Integer.parseInt(temp[0]);
                    int c = Integer.parseInt(temp[1]);
                    int[][] inp = new int[r][c];
                    
                    

                    for(int i=0;i<r;i++){
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    }

                    
                    int[] ve = new int[c];
                    for(int k=0; k<c ; k++){
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    }
                    
                    for(int i=0;i<r;i++){
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    }
                        br.close();
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
                    
                    String[] temp = str.split("\\s");
                    
                    int r = Integer.parseInt(temp[0]);
                    int c = Integer.parseInt(temp[1]);
                    int[][] inp = new int[r][c];
                    
                    

                    for(int i=0;i<r;i++){
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    }

                    
                    int[] ve = new int[c];
                    for(int k=0; k<c ; k++){
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    }
                    
                    for(int i=0;i<r;i++){
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    }
                        br.close();
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br String[] temp = str.split("\\s"); temp str.split("\\s") str.split str "\\s" int r = Integer.parseInt(temp[0]); r Integer.parseInt(temp[0]) Integer.parseInt Integer temp[0] temp 0 int c = Integer.parseInt(temp[1]); c Integer.parseInt(temp[1]) Integer.parseInt Integer temp[1] temp 1 int[][] inp = new int[r][c]; inp new int[r][c] r c for(int i=0;i<r;i++){
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    } int i=0; int i=0; i 0 i<r i r i++ i++ i {
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    } {
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    } str = br.readLine() str br.readLine() br.readLine br String[] line = str.split("\\s"); line str.split("\\s") str.split str "\\s" for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            } int j=0; int j=0; j 0 j<c j c j++ j++ j {
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            } {
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            } int x = Integer.parseInt(line[j]); x Integer.parseInt(line[j]) Integer.parseInt Integer line[j] line j inp[i][j]= x inp[i][j] inp[i] inp i j x int[] ve = new int[c]; ve new int[c] c for(int k=0; k<c ; k++){
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    } int k=0; int k=0; k 0 k<c k c k++ k++ k {
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    } {
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    } str = br.readLine() str br.readLine() br.readLine br String[] strs = str.split("\\s"); strs str.split("\\s") str.split str "\\s" ve[k] = Integer.parseInt(strs[0]) ve[k] ve k Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 for(int i=0;i<r;i++){
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    } int i=0; int i=0; i 0 i<r i r i++ i++ i {
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    } {
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    } int ans =0; ans 0 int atemp = 0; atemp 0 for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        } int j =0; int j =0; j 0 j<c j c j++ j++ j {
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        } {
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        } atemp = inp[i][j] * ve[j] atemp inp[i][j] * ve[j] inp[i][j] inp[i] inp i j ve[j] ve j ans += atemp ans atemp System.out.println(ans) System.out.println System.out System System.out ans br.close() br.close br String[] args args public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
                    
                    String[] temp = str.split("\\s");
                    
                    int r = Integer.parseInt(temp[0]);
                    int c = Integer.parseInt(temp[1]);
                    int[][] inp = new int[r][c];
                    
                    

                    for(int i=0;i<r;i++){
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    }

                    
                    int[] ve = new int[c];
                    for(int k=0; k<c ; k++){
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    }
                    
                    for(int i=0;i<r;i++){
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    }
                        br.close();
    }
} public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
                    
                    String[] temp = str.split("\\s");
                    
                    int r = Integer.parseInt(temp[0]);
                    int c = Integer.parseInt(temp[1]);
                    int[][] inp = new int[r][c];
                    
                    

                    for(int i=0;i<r;i++){
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    }

                    
                    int[] ve = new int[c];
                    for(int k=0; k<c ; k++){
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    }
                    
                    for(int i=0;i<r;i++){
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    }
                        br.close();
    }
} Main
import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
                    
                    String[] temp = str.split("\\s");
                    
                    int r = Integer.parseInt(temp[0]);
                    int c = Integer.parseInt(temp[1]);
                    int[][] inp = new int[r][c];
                    
                    

                    for(int i=0;i<r;i++){
                        str = br.readLine();
                        String[] line = str.split("\\s");
                            for(int j=0; j<c; j++){
                                int x = Integer.parseInt(line[j]);
                                inp[i][j]= x;
                            }
                    }

                    
                    int[] ve = new int[c];
                    for(int k=0; k<c ; k++){
                        str = br.readLine();
                        String[] strs = str.split("\\s");
                        ve[k] = Integer.parseInt(strs[0]);
                        //System.out.println(ve[k]);
                    }
                    
                    for(int i=0;i<r;i++){
                        int ans =0;
                        int atemp = 0;
                        for(int j =0;j<c;j++){
                         atemp = inp[i][j] * ve[j];
                         ans += atemp;  
                        }
                        System.out.println(ans);
                    }
                        br.close();
    }
}