import java.util.ArrayList;
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        int n, m, A[][], i, j, c, a = 1, cnt;
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> b = new ArrayList<Integer>();
        n = sc.nextInt();
        m = sc.nextInt();
        A = new int[n][m];
         
        for(i = 0; n  > i; i++){
            for(j = 0; m > j; j++){
                A[i][j] = sc.nextInt();
            }
        }
         
        for(cnt = 0; cnt < m ; cnt++){
            a = sc.nextInt();
            b.add(new Integer(a));
        }
         
        for(i = 0; n > i ; i++){
            c = 0;
            for(j = 0;m > j; j++){
                c += b.get(new Integer(j)) * A[i][j];
            }
            System.out.println(c);
        }
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz