

import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n, m, c, sum;
		n = scan.nextInt();
		m = scan.nextInt();
		c = 0;// list2??§?????¨
		sum = 0;// ?¨???????????¨??????§?????????
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

		// list1???(n*m)????????°????????\??????
		for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		}
		// list2???m????????°????????\??????
		for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		}

		// m??????????¨????
		for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		}
		System.out.print(new String(sb));

	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n, m, c, sum;
		n = scan.nextInt();
		m = scan.nextInt();
		c = 0;// list2??§?????¨
		sum = 0;// ?¨???????????¨??????§?????????
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

		// list1???(n*m)????????°????????\??????
		for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		}
		// list2???m????????°????????\??????
		for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		}

		// m??????????¨????
		for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		}
		System.out.print(new String(sb));

	}
} Main public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n, m, c, sum;
		n = scan.nextInt();
		m = scan.nextInt();
		c = 0;// list2??§?????¨
		sum = 0;// ?¨???????????¨??????§?????????
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

		// list1???(n*m)????????°????????\??????
		for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		}
		// list2???m????????°????????\??????
		for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		}

		// m??????????¨????
		for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		}
		System.out.print(new String(sb));

	} main {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n, m, c, sum;
		n = scan.nextInt();
		m = scan.nextInt();
		c = 0;// list2??§?????¨
		sum = 0;// ?¨???????????¨??????§?????????
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

		// list1???(n*m)????????°????????\??????
		for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		}
		// list2???m????????°????????\??????
		for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		}

		// m??????????¨????
		for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		}
		System.out.print(new String(sb));

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int n n m m c c sum; sum n = scan.nextInt() n scan.nextInt() scan.nextInt scan m = scan.nextInt() m scan.nextInt() scan.nextInt scan c = 0 c 0 sum = 0 sum 0 List<Integer> list1 = new ArrayList<Integer>(); list1 new ArrayList<Integer>() List<Integer> list2 = new ArrayList<Integer>(); list2 new ArrayList<Integer>() for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		} int count = 0; int count = 0; count 0 count < (n * m) count (n * m) n m count++ count++ count {
			list1.add(scan.nextInt());
		} {
			list1.add(scan.nextInt());
		} list1.add(scan.nextInt()) list1.add list1 scan.nextInt() scan.nextInt scan for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		} int count2 = 0; int count2 = 0; count2 0 count2 < m count2 m count2++ count2++ count2 {
			list2.add(scan.nextInt());
		} {
			list2.add(scan.nextInt());
		} list2.add(scan.nextInt()) list2.add list2 scan.nextInt() scan.nextInt scan for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		} int count3 = 0; int count3 = 0; count3 0 count3 < (n * m) count3 (n * m) n m count3++ count3++ count3 {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		} {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		} sum = sum + list1.get(count3) * list2.get(c) sum sum + list1.get(count3) * list2.get(c) sum list1.get(count3) * list2.get(c) list1.get(count3) list1.get list1 count3 list2.get(c) list2.get list2 c if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			} c == (m-1) c (m-1) m 1 {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			} sb.append(sum) sb.append sb sum sb.append("\n") sb.append sb "\n" sum = 0 sum 0 c = 0 c 0 {
				c++;
			} c++ c System.out.print(new String(sb)) System.out.print System.out System System.out new String(sb) String args[] args public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n, m, c, sum;
		n = scan.nextInt();
		m = scan.nextInt();
		c = 0;// list2??§?????¨
		sum = 0;// ?¨???????????¨??????§?????????
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

		// list1???(n*m)????????°????????\??????
		for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		}
		// list2???m????????°????????\??????
		for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		}

		// m??????????¨????
		for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		}
		System.out.print(new String(sb));

	}
} public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n, m, c, sum;
		n = scan.nextInt();
		m = scan.nextInt();
		c = 0;// list2??§?????¨
		sum = 0;// ?¨???????????¨??????§?????????
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

		// list1???(n*m)????????°????????\??????
		for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		}
		// list2???m????????°????????\??????
		for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		}

		// m??????????¨????
		for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		}
		System.out.print(new String(sb));

	}
} Main


import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n, m, c, sum;
		n = scan.nextInt();
		m = scan.nextInt();
		c = 0;// list2??§?????¨
		sum = 0;// ?¨???????????¨??????§?????????
		List<Integer> list1 = new ArrayList<Integer>();
		List<Integer> list2 = new ArrayList<Integer>();

		// list1???(n*m)????????°????????\??????
		for (int count = 0; count < (n * m); count++) {
			list1.add(scan.nextInt());
		}
		// list2???m????????°????????\??????
		for (int count2 = 0; count2 < m; count2++) {
			list2.add(scan.nextInt());
		}

		// m??????????¨????
		for (int count3 = 0; count3 < (n * m); count3++) {
			sum = sum + list1.get(count3) * list2.get(c);
			
			if (c == (m-1)) {// ???????????????????????°??§StringBuilder???sum???????????\??????
				sb.append(sum);
				sb.append("\n");
				sum = 0;// sum??????????????????
				c = 0;// list2??§?????¨??????c??????????????????
			}else{
				c++;
			}
		}
		System.out.print(new String(sb));

	}
}