import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;


public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int a;
        int b;
        ArrayList<Integer> A = new ArrayList<Integer>();
        ArrayList<Integer> B = new ArrayList<Integer>();
        for(int i = 0;i <= n * m - 1;i++){
            a = scan.nextInt();
            A.add(a);
        }
        for(int i = 0;i <= m - 1;i++){
            b = scan.nextInt();
            B.add(b);
        }
        for(int i = 0;i <= n - 1;i++){
            cOut(i,m,A,B);
        }
    }

    
    //行列cの生成・出力
    public static void cOut(int x,int m,ArrayList<Integer> A,ArrayList<Integer> B){
        int a;
        int b;
        int cSum = 0;
        for(int i = 0;i <= m - 1;i++){
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        }
        System.out.println(cSum);
    }
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int a;
        int b;
        ArrayList<Integer> A = new ArrayList<Integer>();
        ArrayList<Integer> B = new ArrayList<Integer>();
        for(int i = 0;i <= n * m - 1;i++){
            a = scan.nextInt();
            A.add(a);
        }
        for(int i = 0;i <= m - 1;i++){
            b = scan.nextInt();
            B.add(b);
        }
        for(int i = 0;i <= n - 1;i++){
            cOut(i,m,A,B);
        }
    }

    
    //行列cの生成・出力
    public static void cOut(int x,int m,ArrayList<Integer> A,ArrayList<Integer> B){
        int a;
        int b;
        int cSum = 0;
        for(int i = 0;i <= m - 1;i++){
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        }
        System.out.println(cSum);
    }
} Main public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int a;
        int b;
        ArrayList<Integer> A = new ArrayList<Integer>();
        ArrayList<Integer> B = new ArrayList<Integer>();
        for(int i = 0;i <= n * m - 1;i++){
            a = scan.nextInt();
            A.add(a);
        }
        for(int i = 0;i <= m - 1;i++){
            b = scan.nextInt();
            B.add(b);
        }
        for(int i = 0;i <= n - 1;i++){
            cOut(i,m,A,B);
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int a;
        int b;
        ArrayList<Integer> A = new ArrayList<Integer>();
        ArrayList<Integer> B = new ArrayList<Integer>();
        for(int i = 0;i <= n * m - 1;i++){
            a = scan.nextInt();
            A.add(a);
        }
        for(int i = 0;i <= m - 1;i++){
            b = scan.nextInt();
            B.add(b);
        }
        for(int i = 0;i <= n - 1;i++){
            cOut(i,m,A,B);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int m = scan.nextInt(); m scan.nextInt() scan.nextInt scan int a; a int b; b ArrayList<Integer> A = new ArrayList<Integer>(); A new ArrayList<Integer>() ArrayList<Integer> B = new ArrayList<Integer>(); B new ArrayList<Integer>() for(int i = 0;i <= n * m - 1;i++){
            a = scan.nextInt();
            A.add(a);
        } int i = 0; int i = 0; i 0 i <= n * m - 1 i n * m - 1 n * m n m 1 i++ i++ i {
            a = scan.nextInt();
            A.add(a);
        } {
            a = scan.nextInt();
            A.add(a);
        } a = scan.nextInt() a scan.nextInt() scan.nextInt scan A.add(a) A.add A a for(int i = 0;i <= m - 1;i++){
            b = scan.nextInt();
            B.add(b);
        } int i = 0; int i = 0; i 0 i <= m - 1 i m - 1 m 1 i++ i++ i {
            b = scan.nextInt();
            B.add(b);
        } {
            b = scan.nextInt();
            B.add(b);
        } b = scan.nextInt() b scan.nextInt() scan.nextInt scan B.add(b) B.add B b for(int i = 0;i <= n - 1;i++){
            cOut(i,m,A,B);
        } int i = 0; int i = 0; i 0 i <= n - 1 i n - 1 n 1 i++ i++ i {
            cOut(i,m,A,B);
        } {
            cOut(i,m,A,B);
        } cOut(i,m,A,B) cOut i m A B String[] args args //行列cの生成・出力
    public static void cOut(int x,int m,ArrayList<Integer> A,ArrayList<Integer> B){
        int a;
        int b;
        int cSum = 0;
        for(int i = 0;i <= m - 1;i++){
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        }
        System.out.println(cSum);
    } cOut {
        int a;
        int b;
        int cSum = 0;
        for(int i = 0;i <= m - 1;i++){
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        }
        System.out.println(cSum);
    } int a; a int b; b int cSum = 0; cSum 0 for(int i = 0;i <= m - 1;i++){
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        } int i = 0; int i = 0; i 0 i <= m - 1 i m - 1 m 1 i++ i++ i {
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        } {
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        } a = A.get(i + m * x) a A.get(i + m * x) A.get A i + m * x i m * x m x b = B.get(i) b B.get(i) B.get B i cSum += a * b cSum a * b a b System.out.println(cSum) System.out.println System.out System System.out cSum int x x int m m ArrayList<Integer> A A ArrayList<Integer> B B public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int a;
        int b;
        ArrayList<Integer> A = new ArrayList<Integer>();
        ArrayList<Integer> B = new ArrayList<Integer>();
        for(int i = 0;i <= n * m - 1;i++){
            a = scan.nextInt();
            A.add(a);
        }
        for(int i = 0;i <= m - 1;i++){
            b = scan.nextInt();
            B.add(b);
        }
        for(int i = 0;i <= n - 1;i++){
            cOut(i,m,A,B);
        }
    }

    
    //行列cの生成・出力
    public static void cOut(int x,int m,ArrayList<Integer> A,ArrayList<Integer> B){
        int a;
        int b;
        int cSum = 0;
        for(int i = 0;i <= m - 1;i++){
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        }
        System.out.println(cSum);
    }
} public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int a;
        int b;
        ArrayList<Integer> A = new ArrayList<Integer>();
        ArrayList<Integer> B = new ArrayList<Integer>();
        for(int i = 0;i <= n * m - 1;i++){
            a = scan.nextInt();
            A.add(a);
        }
        for(int i = 0;i <= m - 1;i++){
            b = scan.nextInt();
            B.add(b);
        }
        for(int i = 0;i <= n - 1;i++){
            cOut(i,m,A,B);
        }
    }

    
    //行列cの生成・出力
    public static void cOut(int x,int m,ArrayList<Integer> A,ArrayList<Integer> B){
        int a;
        int b;
        int cSum = 0;
        for(int i = 0;i <= m - 1;i++){
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        }
        System.out.println(cSum);
    }
} Main
import java.io.*;
import java.util.Scanner;
import java.util.ArrayList;


public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        int a;
        int b;
        ArrayList<Integer> A = new ArrayList<Integer>();
        ArrayList<Integer> B = new ArrayList<Integer>();
        for(int i = 0;i <= n * m - 1;i++){
            a = scan.nextInt();
            A.add(a);
        }
        for(int i = 0;i <= m - 1;i++){
            b = scan.nextInt();
            B.add(b);
        }
        for(int i = 0;i <= n - 1;i++){
            cOut(i,m,A,B);
        }
    }

    
    //行列cの生成・出力
    public static void cOut(int x,int m,ArrayList<Integer> A,ArrayList<Integer> B){
        int a;
        int b;
        int cSum = 0;
        for(int i = 0;i <= m - 1;i++){
            a = A.get(i + m * x);
            b = B.get(i);
            cSum += a * b;
        }
        System.out.println(cSum);
    }
}
