
import java.util.*;
class Main {
    public static void main(String... args) {
        Scanner scan = new Scanner(System.in);
        int vertical = scan.nextInt();
        int horizon  = scan.nextInt();
        int[][] container = new int[vertical][horizon];
        for(int v = 0; v < vertical; v++) {
            for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            }
        }
        for(int h = 0; h < horizon; h++) {
            int multi = scan.nextInt();
            for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            }
        }
        for(int v = 0; v < vertical; v++) {
            int total = 0;
            for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            }
            System.out.println(total);
        }
    }
} import java.util.*; util.* java class Main {
    public static void main(String... args) {
        Scanner scan = new Scanner(System.in);
        int vertical = scan.nextInt();
        int horizon  = scan.nextInt();
        int[][] container = new int[vertical][horizon];
        for(int v = 0; v < vertical; v++) {
            for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            }
        }
        for(int h = 0; h < horizon; h++) {
            int multi = scan.nextInt();
            for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            }
        }
        for(int v = 0; v < vertical; v++) {
            int total = 0;
            for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            }
            System.out.println(total);
        }
    }
} Main public static void main(String... args) {
        Scanner scan = new Scanner(System.in);
        int vertical = scan.nextInt();
        int horizon  = scan.nextInt();
        int[][] container = new int[vertical][horizon];
        for(int v = 0; v < vertical; v++) {
            for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            }
        }
        for(int h = 0; h < horizon; h++) {
            int multi = scan.nextInt();
            for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            }
        }
        for(int v = 0; v < vertical; v++) {
            int total = 0;
            for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            }
            System.out.println(total);
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int vertical = scan.nextInt();
        int horizon  = scan.nextInt();
        int[][] container = new int[vertical][horizon];
        for(int v = 0; v < vertical; v++) {
            for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            }
        }
        for(int h = 0; h < horizon; h++) {
            int multi = scan.nextInt();
            for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            }
        }
        for(int v = 0; v < vertical; v++) {
            int total = 0;
            for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            }
            System.out.println(total);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int vertical = scan.nextInt(); vertical scan.nextInt() scan.nextInt scan int horizon  = scan.nextInt(); horizon scan.nextInt() scan.nextInt scan int[][] container = new int[vertical][horizon]; container new int[vertical][horizon] vertical horizon for(int v = 0; v < vertical; v++) {
            for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            }
        } int v = 0; int v = 0; v 0 v < vertical v vertical v++ v++ v {
            for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            }
        } {
            for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            }
        } for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            } int h = 0; int h = 0; h 0 h < horizon h horizon h++ h++ h {
                container[v][h] = scan.nextInt();
            } {
                container[v][h] = scan.nextInt();
            } container[v][h] = scan.nextInt() container[v][h] container[v] container v h scan.nextInt() scan.nextInt scan for(int h = 0; h < horizon; h++) {
            int multi = scan.nextInt();
            for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            }
        } int h = 0; int h = 0; h 0 h < horizon h horizon h++ h++ h {
            int multi = scan.nextInt();
            for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            }
        } {
            int multi = scan.nextInt();
            for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            }
        } int multi = scan.nextInt(); multi scan.nextInt() scan.nextInt scan for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            } int v = 0; int v = 0; v 0 v < vertical v vertical v++ v++ v {
                container[v][h] *= multi;
            } {
                container[v][h] *= multi;
            } container[v][h] *= multi container[v][h] container[v] container v h multi for(int v = 0; v < vertical; v++) {
            int total = 0;
            for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            }
            System.out.println(total);
        } int v = 0; int v = 0; v 0 v < vertical v vertical v++ v++ v {
            int total = 0;
            for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            }
            System.out.println(total);
        } {
            int total = 0;
            for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            }
            System.out.println(total);
        } int total = 0; total 0 for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            } int h = 0; int h = 0; h 0 h < horizon h horizon h++ h++ h {
               total += container[v][h];
            } {
               total += container[v][h];
            } total += container[v][h] total container[v][h] container[v] container v h System.out.println(total) System.out.println System.out System System.out total String... args args

import java.util.*;
class Main {
    public static void main(String... args) {
        Scanner scan = new Scanner(System.in);
        int vertical = scan.nextInt();
        int horizon  = scan.nextInt();
        int[][] container = new int[vertical][horizon];
        for(int v = 0; v < vertical; v++) {
            for (int h = 0; h < horizon;  h++) {
                container[v][h] = scan.nextInt();
            }
        }
        for(int h = 0; h < horizon; h++) {
            int multi = scan.nextInt();
            for (int v = 0; v < vertical;  v++) {
                container[v][h] *= multi;
            }
        }
        for(int v = 0; v < vertical; v++) {
            int total = 0;
            for (int h = 0; h < horizon;  h++) {
               total += container[v][h];
            }
            System.out.println(total);
        }
    }
}
