
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 *
 * @author k16069kk
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int n = 0;
        int m = 0;

        int l = 0;
        int a = 0;
        int matrix_a[][] = new int[100][100]; //n*m
        int matrix_b[] = new int[100];   //m*1
        int matrix_ans [] = new int[100]; //n*1
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        }
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        }
        
        for (int i = 0; i < n; i++) {
            System.out.println(matrix_ans[i]);
        }

    }

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

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int n = 0;
        int m = 0;

        int l = 0;
        int a = 0;
        int matrix_a[][] = new int[100][100]; //n*m
        int matrix_b[] = new int[100];   //m*1
        int matrix_ans [] = new int[100]; //n*1
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        }
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        }
        
        for (int i = 0; i < n; i++) {
            System.out.println(matrix_ans[i]);
        }

    }

} Main /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int n = 0;
        int m = 0;

        int l = 0;
        int a = 0;
        int matrix_a[][] = new int[100][100]; //n*m
        int matrix_b[] = new int[100];   //m*1
        int matrix_ans [] = new int[100]; //n*1
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        }
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        }
        
        for (int i = 0; i < n; i++) {
            System.out.println(matrix_ans[i]);
        }

    } main {
        int n = 0;
        int m = 0;

        int l = 0;
        int a = 0;
        int matrix_a[][] = new int[100][100]; //n*m
        int matrix_b[] = new int[100];   //m*1
        int matrix_ans [] = new int[100]; //n*1
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        }
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        }
        
        for (int i = 0; i < n; i++) {
            System.out.println(matrix_ans[i]);
        }

    } int n = 0; n 0 int m = 0; m 0 int l = 0; l 0 int a = 0; a 0 int matrix_a[][] = new int[100][100]; matrix_a new int[100][100] 100 100 int matrix_b[] = new int[100]; matrix_b new int[100] 100 int matrix_ans [] = new int[100]; matrix_ans new int[100] 100 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line; line while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        } java.util.StringTokenizer st = new StringTokenizer(line, " "); st new StringTokenizer(line, " ") if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            } n == 0 && m == 0 n == 0 n 0 m == 0 m 0 {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } n = Integer.parseInt(st.nextToken()) n Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st m = Integer.parseInt(st.nextToken()) m Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            } l != n && l < n l != n l n l < n l n {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                } st.hasMoreTokens() st.hasMoreTokens st {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                } for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    } {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    } matrix_a[l][i] = Integer.parseInt(st.nextToken()) matrix_a[l][i] matrix_a[l] matrix_a l i Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st l++ l {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            } while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                } st.hasMoreTokens() st.hasMoreTokens st {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                } matrix_b[a] = Integer.parseInt(st.nextToken()) matrix_b[a] matrix_b a Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st a++ a if(l == n && a == m) break; l == n && a == m l == n l n a == m a m break; for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        } {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        } for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            } {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            } int num1 = matrix_a[i][j]; num1 matrix_a[i][j] matrix_a[i] matrix_a i j int num2 = matrix_b[j]; num2 matrix_b[j] matrix_b j int ans = num1 * num2; ans num1 * num2 num1 num2 matrix_ans[i] += ans matrix_ans[i] matrix_ans i ans for (int i = 0; i < n; i++) {
            System.out.println(matrix_ans[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            System.out.println(matrix_ans[i]);
        } {
            System.out.println(matrix_ans[i]);
        } System.out.println(matrix_ans[i]) System.out.println System.out System System.out matrix_ans[i] matrix_ans i String[] args args public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int n = 0;
        int m = 0;

        int l = 0;
        int a = 0;
        int matrix_a[][] = new int[100][100]; //n*m
        int matrix_b[] = new int[100];   //m*1
        int matrix_ans [] = new int[100]; //n*1
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        }
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        }
        
        for (int i = 0; i < n; i++) {
            System.out.println(matrix_ans[i]);
        }

    }

} public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int n = 0;
        int m = 0;

        int l = 0;
        int a = 0;
        int matrix_a[][] = new int[100][100]; //n*m
        int matrix_b[] = new int[100];   //m*1
        int matrix_ans [] = new int[100]; //n*1
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        }
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        }
        
        for (int i = 0; i < n; i++) {
            System.out.println(matrix_ans[i]);
        }

    }

} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 *
 * @author k16069kk
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        int n = 0;
        int m = 0;

        int l = 0;
        int a = 0;
        int matrix_a[][] = new int[100][100]; //n*m
        int matrix_b[] = new int[100];   //m*1
        int matrix_ans [] = new int[100]; //n*1
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = br.readLine()) != null) {
            java.util.StringTokenizer st = new StringTokenizer(line, " ");
            if (n == 0 && m == 0) {
                n = Integer.parseInt(st.nextToken());
                m = Integer.parseInt(st.nextToken());
            } else if (l != n && l < n) {
                while (st.hasMoreTokens()) {
                    for (int i = 0; i < m; i++) {
                        matrix_a[l][i] = Integer.parseInt(st.nextToken());
                    }
                    l++;
                }
            } else {
                while (st.hasMoreTokens()) {
                    matrix_b[a] = Integer.parseInt(st.nextToken());
                    a++;
                }
            }
            if(l == n && a == m) break;
        }
        
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                int num1 = matrix_a[i][j];
                int num2 = matrix_b[j];
                int ans = num1 * num2; 
                matrix_ans[i] += ans;
            }
        }
        
        for (int i = 0; i < n; i++) {
            System.out.println(matrix_ans[i]);
        }

    }

}

