import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		//Scanner????????????????????????
		Scanner scan = new Scanner(System.in);
		//A????????????(n,m)
		int n = scan.nextInt();
		int m = scan.nextInt();

		//a?????????
		int[][] aAry = new int[n][m];
		for(int i = 0; i < n; i++){

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		}

		//b?????????
		int[] bAry = new int[m];
		//?????????????´?
		for(int i = 0; i < m; i++ ){

			bAry[i] = scan.nextInt();
		}

		scan.close();

		//?????????????????\???????????°
		int intAnswer = 0;

		for(int i =0; i < n; i++){
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		}


	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		//Scanner????????????????????????
		Scanner scan = new Scanner(System.in);
		//A????????????(n,m)
		int n = scan.nextInt();
		int m = scan.nextInt();

		//a?????????
		int[][] aAry = new int[n][m];
		for(int i = 0; i < n; i++){

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		}

		//b?????????
		int[] bAry = new int[m];
		//?????????????´?
		for(int i = 0; i < m; i++ ){

			bAry[i] = scan.nextInt();
		}

		scan.close();

		//?????????????????\???????????°
		int intAnswer = 0;

		for(int i =0; i < n; i++){
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		}


	}
} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		//Scanner????????????????????????
		Scanner scan = new Scanner(System.in);
		//A????????????(n,m)
		int n = scan.nextInt();
		int m = scan.nextInt();

		//a?????????
		int[][] aAry = new int[n][m];
		for(int i = 0; i < n; i++){

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		}

		//b?????????
		int[] bAry = new int[m];
		//?????????????´?
		for(int i = 0; i < m; i++ ){

			bAry[i] = scan.nextInt();
		}

		scan.close();

		//?????????????????\???????????°
		int intAnswer = 0;

		for(int i =0; i < n; i++){
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		}


	} main {
		// TODO ?????????????????????????????????????????????

		//Scanner????????????????????????
		Scanner scan = new Scanner(System.in);
		//A????????????(n,m)
		int n = scan.nextInt();
		int m = scan.nextInt();

		//a?????????
		int[][] aAry = new int[n][m];
		for(int i = 0; i < n; i++){

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		}

		//b?????????
		int[] bAry = new int[m];
		//?????????????´?
		for(int i = 0; i < m; i++ ){

			bAry[i] = scan.nextInt();
		}

		scan.close();

		//?????????????????\???????????°
		int intAnswer = 0;

		for(int i =0; i < n; i++){
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		}


	} 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[][] aAry = new int[n][m]; aAry new int[n][m] n m for(int i = 0; i < n; i++){

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		} {

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		} for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				aAry[i][j] = scan.nextInt();
			} {
				aAry[i][j] = scan.nextInt();
			} aAry[i][j] = scan.nextInt() aAry[i][j] aAry[i] aAry i j scan.nextInt() scan.nextInt scan int[] bAry = new int[m]; bAry new int[m] m for(int i = 0; i < m; i++ ){

			bAry[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {

			bAry[i] = scan.nextInt();
		} {

			bAry[i] = scan.nextInt();
		} bAry[i] = scan.nextInt() bAry[i] bAry i scan.nextInt() scan.nextInt scan scan.close() scan.close scan int intAnswer = 0; intAnswer 0 for(int i =0; i < n; i++){
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		} int i =0; int i =0; i 0 i < n i n i++ i++ i {
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		} {
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		} int intResult = 0; intResult 0 for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			} int j = 0; int j = 0; j 0 j < m j m j++ j++ j {
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			} {
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			} intAnswer = bAry[j] * aAry[i][j] intAnswer bAry[j] * aAry[i][j] bAry[j] bAry j aAry[i][j] aAry[i] aAry i j intResult = intResult + intAnswer intResult intResult + intAnswer intResult intAnswer System.out.println(intResult) System.out.println System.out System System.out intResult String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		//Scanner????????????????????????
		Scanner scan = new Scanner(System.in);
		//A????????????(n,m)
		int n = scan.nextInt();
		int m = scan.nextInt();

		//a?????????
		int[][] aAry = new int[n][m];
		for(int i = 0; i < n; i++){

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		}

		//b?????????
		int[] bAry = new int[m];
		//?????????????´?
		for(int i = 0; i < m; i++ ){

			bAry[i] = scan.nextInt();
		}

		scan.close();

		//?????????????????\???????????°
		int intAnswer = 0;

		for(int i =0; i < n; i++){
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		}


	}
} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		//Scanner????????????????????????
		Scanner scan = new Scanner(System.in);
		//A????????????(n,m)
		int n = scan.nextInt();
		int m = scan.nextInt();

		//a?????????
		int[][] aAry = new int[n][m];
		for(int i = 0; i < n; i++){

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		}

		//b?????????
		int[] bAry = new int[m];
		//?????????????´?
		for(int i = 0; i < m; i++ ){

			bAry[i] = scan.nextInt();
		}

		scan.close();

		//?????????????????\???????????°
		int intAnswer = 0;

		for(int i =0; i < n; i++){
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		}


	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		//Scanner????????????????????????
		Scanner scan = new Scanner(System.in);
		//A????????????(n,m)
		int n = scan.nextInt();
		int m = scan.nextInt();

		//a?????????
		int[][] aAry = new int[n][m];
		for(int i = 0; i < n; i++){

			for(int j = 0; j < m; j++){
				aAry[i][j] = scan.nextInt();
			}
		}

		//b?????????
		int[] bAry = new int[m];
		//?????????????´?
		for(int i = 0; i < m; i++ ){

			bAry[i] = scan.nextInt();
		}

		scan.close();

		//?????????????????\???????????°
		int intAnswer = 0;

		for(int i =0; i < n; i++){
			//?????????????????\???????????°
			int intResult = 0;
			for(int j = 0; j < m; j++){
				//???????????????????????£??\
				intAnswer = bAry[j] * aAry[i][j];
				intResult = intResult + intAnswer;
			}
			System.out.println(intResult);
			//intResult????????????
			//intResult = 0;
		}


	}
}