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

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String[] inputList = br.readLine().split(" ");
			int H = Integer.parseInt(inputList[0]);
			int W = Integer.parseInt(inputList[1]);
			int[][] a = new int[H][W];
			int[] b = new int[H];
			int i, x;
			for (i = 0; i < H; i++) {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			}
			for (i = 0; i < W; i++) {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			}

			for (i = 0; i < H; i++) {
				System.out.println(b[i]);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String[] inputList = br.readLine().split(" ");
			int H = Integer.parseInt(inputList[0]);
			int W = Integer.parseInt(inputList[1]);
			int[][] a = new int[H][W];
			int[] b = new int[H];
			int i, x;
			for (i = 0; i < H; i++) {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			}
			for (i = 0; i < W; i++) {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			}

			for (i = 0; i < H; i++) {
				System.out.println(b[i]);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String[] inputList = br.readLine().split(" ");
			int H = Integer.parseInt(inputList[0]);
			int W = Integer.parseInt(inputList[1]);
			int[][] a = new int[H][W];
			int[] b = new int[H];
			int i, x;
			for (i = 0; i < H; i++) {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			}
			for (i = 0; i < W; i++) {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			}

			for (i = 0; i < H; i++) {
				System.out.println(b[i]);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String[] inputList = br.readLine().split(" ");
			int H = Integer.parseInt(inputList[0]);
			int W = Integer.parseInt(inputList[1]);
			int[][] a = new int[H][W];
			int[] b = new int[H];
			int i, x;
			for (i = 0; i < H; i++) {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			}
			for (i = 0; i < W; i++) {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			}

			for (i = 0; i < H; i++) {
				System.out.println(b[i]);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) try {
			String[] inputList = br.readLine().split(" ");
			int H = Integer.parseInt(inputList[0]);
			int W = Integer.parseInt(inputList[1]);
			int[][] a = new int[H][W];
			int[] b = new int[H];
			int i, x;
			for (i = 0; i < H; i++) {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			}
			for (i = 0; i < W; i++) {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			}

			for (i = 0; i < H; i++) {
				System.out.println(b[i]);
			}
		} catch (IOException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} IOException e {
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			String[] inputList = br.readLine().split(" ");
			int H = Integer.parseInt(inputList[0]);
			int W = Integer.parseInt(inputList[1]);
			int[][] a = new int[H][W];
			int[] b = new int[H];
			int i, x;
			for (i = 0; i < H; i++) {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			}
			for (i = 0; i < W; i++) {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			}

			for (i = 0; i < H; i++) {
				System.out.println(b[i]);
			}
		} String[] inputList = br.readLine().split(" "); inputList br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int H = Integer.parseInt(inputList[0]); H Integer.parseInt(inputList[0]) Integer.parseInt Integer inputList[0] inputList 0 int W = Integer.parseInt(inputList[1]); W Integer.parseInt(inputList[1]) Integer.parseInt Integer inputList[1] inputList 1 int[][] a = new int[H][W]; a new int[H][W] H W int[] b = new int[H]; b new int[H] H int i i x; x for (i = 0; i < H; i++) {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			} i = 0; i = 0 i 0 i < H i H i++ i++ i {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			} {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			} inputList = br.readLine().split(" ") inputList br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				} x = 0; x = 0 x 0 x < inputList.length x inputList.length inputList inputList.length x++ x++ x {
					a[i][x] = Integer.parseInt(inputList[x]);
				} {
					a[i][x] = Integer.parseInt(inputList[x]);
				} a[i][x] = Integer.parseInt(inputList[x]) a[i][x] a[i] a i x Integer.parseInt(inputList[x]) Integer.parseInt Integer inputList[x] inputList x for (i = 0; i < W; i++) {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			} i = 0; i = 0 i 0 i < W i W i++ i++ i {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			} {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			} int input = Integer.parseInt(br.readLine()); input Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				} x = 0; x = 0 x 0 x < H x H x++ x++ x {
					b[x] = b[x] + a[x][i] * input;
				} {
					b[x] = b[x] + a[x][i] * input;
				} b[x] = b[x] + a[x][i] * input b[x] b x b[x] + a[x][i] * input b[x] b x a[x][i] * input a[x][i] a[x] a x i input for (i = 0; i < H; i++) {
				System.out.println(b[i]);
			} i = 0; i = 0 i 0 i < H i H i++ i++ i {
				System.out.println(b[i]);
			} {
				System.out.println(b[i]);
			} System.out.println(b[i]) System.out.println System.out System System.out b[i] b i String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		try {
			String[] inputList = br.readLine().split(" ");
			int H = Integer.parseInt(inputList[0]);
			int W = Integer.parseInt(inputList[1]);
			int[][] a = new int[H][W];
			int[] b = new int[H];
			int i, x;
			for (i = 0; i < H; i++) {
				inputList = br.readLine().split(" ");
				for (x = 0; x < inputList.length; x++) {
					a[i][x] = Integer.parseInt(inputList[x]);
				}
			}
			for (i = 0; i < W; i++) {
				int input = Integer.parseInt(br.readLine());
				for (x = 0; x < H; x++) {
					b[x] = b[x] + a[x][i] * input;
				}
			}

			for (i = 0; i < H; i++) {
				System.out.println(b[i]);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}