import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out);

    int n = sc.nextInt();
    int m = sc.nextInt();

    int[][] a = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    }

    int[][] ans = new int[n][m];

    for (int i = 0; i < m; i++) {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    }

    for (int[] x : ans) {
      pw.println(Arrays.stream(x).sum());
    }

    pw.flush();
    sc.close();
  }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out);

    int n = sc.nextInt();
    int m = sc.nextInt();

    int[][] a = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    }

    int[][] ans = new int[n][m];

    for (int i = 0; i < m; i++) {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    }

    for (int[] x : ans) {
      pw.println(Arrays.stream(x).sum());
    }

    pw.flush();
    sc.close();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out);

    int n = sc.nextInt();
    int m = sc.nextInt();

    int[][] a = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    }

    int[][] ans = new int[n][m];

    for (int i = 0; i < m; i++) {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    }

    for (int[] x : ans) {
      pw.println(Arrays.stream(x).sum());
    }

    pw.flush();
    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out);

    int n = sc.nextInt();
    int m = sc.nextInt();

    int[][] a = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    }

    int[][] ans = new int[n][m];

    for (int i = 0; i < m; i++) {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    }

    for (int[] x : ans) {
      pw.println(Arrays.stream(x).sum());
    }

    pw.flush();
    sc.close();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int m = sc.nextInt(); m sc.nextInt() sc.nextInt sc int[][] a = new int[n][m]; a new int[n][m] n m for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    } {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    } for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      } int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
        a[i][j] = sc.nextInt();
      } {
        a[i][j] = sc.nextInt();
      } a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc int[][] ans = new int[n][m]; ans new int[n][m] n m for (int i = 0; i < m; i++) {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    } int i = 0; int i = 0; i 0 i < m i m i++ i++ i {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    } {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    } int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
        ans[j][i] = a[j][i] * b;
      } {
        ans[j][i] = a[j][i] * b;
      } ans[j][i] = a[j][i] * b ans[j][i] ans[j] ans j i a[j][i] * b a[j][i] a[j] a j i b for (int[] x : ans) {
      pw.println(Arrays.stream(x).sum());
    } int[] x ans {
      pw.println(Arrays.stream(x).sum());
    } {
      pw.println(Arrays.stream(x).sum());
    } pw.println(Arrays.stream(x).sum()) pw.println pw Arrays.stream(x).sum() Arrays.stream(x).sum Arrays.stream(x) Arrays.stream Arrays x pw.flush() pw.flush pw sc.close() sc.close sc String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out);

    int n = sc.nextInt();
    int m = sc.nextInt();

    int[][] a = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    }

    int[][] ans = new int[n][m];

    for (int i = 0; i < m; i++) {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    }

    for (int[] x : ans) {
      pw.println(Arrays.stream(x).sum());
    }

    pw.flush();
    sc.close();
  }
} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out);

    int n = sc.nextInt();
    int m = sc.nextInt();

    int[][] a = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    }

    int[][] ans = new int[n][m];

    for (int i = 0; i < m; i++) {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    }

    for (int[] x : ans) {
      pw.println(Arrays.stream(x).sum());
    }

    pw.flush();
    sc.close();
  }
} Main
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    PrintWriter pw = new PrintWriter(System.out);

    int n = sc.nextInt();
    int m = sc.nextInt();

    int[][] a = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        a[i][j] = sc.nextInt();
      }
    }

    int[][] ans = new int[n][m];

    for (int i = 0; i < m; i++) {      
      int b = sc.nextInt();
      for (int j = 0; j < n; j++) {
        ans[j][i] = a[j][i] * b;
      }
    }

    for (int[] x : ans) {
      pw.println(Arrays.stream(x).sum());
    }

    pw.flush();
    sc.close();
  }
}
