import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int n = 0, m = 0;
		int b = 0;
		int temp1 = 0;
		int temp2 = 0;
		int sum = 0;
		int count1 = 0;
		int count2 = 0;
		String str;
		ArrayList<String> st = new ArrayList<String>(); // ??\?????????????????????b,f,r,v
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????
		/**
		 * ???????????\???(n*m??????)
		 */
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt(); // n,m????±????
		m = scan.nextInt();
		int matrix[][] = new int[n][m];
		int vector[] = new int[m];
		int anser[] = new int[n];
		// System.out.println(n+" "+m);
		for (int a = 0; a < n; ++a) { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		}
		for (int k = 0; k < n; ++k) { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		}
		/**
		 * ???????????\???(m*1????????????)
		 */
		for (int i = 0; i < m; ++i) {
			b = scan.nextInt();
			vector[i] = b;
		}
		/**
		 * ?¨???? n*m???????????¨m*1????????????????????????n*1????§£????±?????????????
		 */
			for (int d = 0; d < n; ++d) {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		}

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

	public static void main(String[] args) {
		int n = 0, m = 0;
		int b = 0;
		int temp1 = 0;
		int temp2 = 0;
		int sum = 0;
		int count1 = 0;
		int count2 = 0;
		String str;
		ArrayList<String> st = new ArrayList<String>(); // ??\?????????????????????b,f,r,v
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????
		/**
		 * ???????????\???(n*m??????)
		 */
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt(); // n,m????±????
		m = scan.nextInt();
		int matrix[][] = new int[n][m];
		int vector[] = new int[m];
		int anser[] = new int[n];
		// System.out.println(n+" "+m);
		for (int a = 0; a < n; ++a) { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		}
		for (int k = 0; k < n; ++k) { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		}
		/**
		 * ???????????\???(m*1????????????)
		 */
		for (int i = 0; i < m; ++i) {
			b = scan.nextInt();
			vector[i] = b;
		}
		/**
		 * ?¨???? n*m???????????¨m*1????????????????????????n*1????§£????±?????????????
		 */
			for (int d = 0; d < n; ++d) {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		}

	}
} Main public static void main(String[] args) {
		int n = 0, m = 0;
		int b = 0;
		int temp1 = 0;
		int temp2 = 0;
		int sum = 0;
		int count1 = 0;
		int count2 = 0;
		String str;
		ArrayList<String> st = new ArrayList<String>(); // ??\?????????????????????b,f,r,v
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????
		/**
		 * ???????????\???(n*m??????)
		 */
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt(); // n,m????±????
		m = scan.nextInt();
		int matrix[][] = new int[n][m];
		int vector[] = new int[m];
		int anser[] = new int[n];
		// System.out.println(n+" "+m);
		for (int a = 0; a < n; ++a) { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		}
		for (int k = 0; k < n; ++k) { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		}
		/**
		 * ???????????\???(m*1????????????)
		 */
		for (int i = 0; i < m; ++i) {
			b = scan.nextInt();
			vector[i] = b;
		}
		/**
		 * ?¨???? n*m???????????¨m*1????????????????????????n*1????§£????±?????????????
		 */
			for (int d = 0; d < n; ++d) {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		}

	} main {
		int n = 0, m = 0;
		int b = 0;
		int temp1 = 0;
		int temp2 = 0;
		int sum = 0;
		int count1 = 0;
		int count2 = 0;
		String str;
		ArrayList<String> st = new ArrayList<String>(); // ??\?????????????????????b,f,r,v
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????
		/**
		 * ???????????\???(n*m??????)
		 */
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt(); // n,m????±????
		m = scan.nextInt();
		int matrix[][] = new int[n][m];
		int vector[] = new int[m];
		int anser[] = new int[n];
		// System.out.println(n+" "+m);
		for (int a = 0; a < n; ++a) { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		}
		for (int k = 0; k < n; ++k) { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		}
		/**
		 * ???????????\???(m*1????????????)
		 */
		for (int i = 0; i < m; ++i) {
			b = scan.nextInt();
			vector[i] = b;
		}
		/**
		 * ?¨???? n*m???????????¨m*1????????????????????????n*1????§£????±?????????????
		 */
			for (int d = 0; d < n; ++d) {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		}

	} int n = 0 n 0 m = 0; m 0 int b = 0; b 0 int temp1 = 0; temp1 0 int temp2 = 0; temp2 0 int sum = 0; sum 0 int count1 = 0; count1 0 int count2 = 0; count2 0 String str; str ArrayList<String> st = new ArrayList<String>(); st new ArrayList<String>() ArrayList<Integer> parse = new ArrayList<Integer>(); parse new ArrayList<Integer>() Scanner scan = new Scanner(System.in); scan new Scanner(System.in) n = scan.nextInt() n scan.nextInt() scan.nextInt scan m = scan.nextInt() m scan.nextInt() scan.nextInt scan int matrix[][] = new int[n][m]; matrix new int[n][m] n m int vector[] = new int[m]; vector new int[m] m int anser[] = new int[n]; anser new int[n] n for (int a = 0; a < n; ++a) { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		} int a = 0; int a = 0; a 0 a < n a n ++a ++a a { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		} { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		} for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			} int t = 0; int t = 0; t 0 t < m t m ++t ++t t { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			} { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			} st.add(scan.next()) st.add st scan.next() scan.next scan for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			} int p = count1; int p = count1; p count1 p < st.size() p st.size() st.size st ++p ++p p { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			} { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			} str = st.get(p) str st.get(p) st.get st p temp1 = Integer.parseInt(str) temp1 Integer.parseInt(str) Integer.parseInt Integer str parse.add(temp1) parse.add parse temp1 count1 += m count1 m for (int k = 0; k < n; ++k) { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		} int k = 0; int k = 0; k 0 k < n k n ++k ++k k { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		} { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		} for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			} int l = 0; int l = 0; l 0 l < m l m ++l ++l l {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			} {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			} matrix[k][l] = parse.get(count2++) matrix[k][l] matrix[k] matrix k l parse.get(count2++) parse.get parse count2++ count2 for (int i = 0; i < m; ++i) {
			b = scan.nextInt();
			vector[i] = b;
		} int i = 0; int i = 0; i 0 i < m i m ++i ++i i {
			b = scan.nextInt();
			vector[i] = b;
		} {
			b = scan.nextInt();
			vector[i] = b;
		} b = scan.nextInt() b scan.nextInt() scan.nextInt scan vector[i] = b vector[i] vector i b for (int d = 0; d < n; ++d) {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		} int d = 0; int d = 0; d 0 d < n d n ++d ++d d {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		} {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		} for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				} int f = 0; int f = 0; f 0 f < m f m ++f ++f f {
					sum += matrix[d][f] * vector[f];
				} {
					sum += matrix[d][f] * vector[f];
				} sum += matrix[d][f] * vector[f] sum matrix[d][f] * vector[f] matrix[d][f] matrix[d] matrix d f vector[f] vector f anser[d] = sum anser[d] anser d sum System.out.println(anser[d]) System.out.println System.out System System.out anser[d] anser d sum = 0 sum 0 String[] args args public class Main {

	public static void main(String[] args) {
		int n = 0, m = 0;
		int b = 0;
		int temp1 = 0;
		int temp2 = 0;
		int sum = 0;
		int count1 = 0;
		int count2 = 0;
		String str;
		ArrayList<String> st = new ArrayList<String>(); // ??\?????????????????????b,f,r,v
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????
		/**
		 * ???????????\???(n*m??????)
		 */
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt(); // n,m????±????
		m = scan.nextInt();
		int matrix[][] = new int[n][m];
		int vector[] = new int[m];
		int anser[] = new int[n];
		// System.out.println(n+" "+m);
		for (int a = 0; a < n; ++a) { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		}
		for (int k = 0; k < n; ++k) { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		}
		/**
		 * ???????????\???(m*1????????????)
		 */
		for (int i = 0; i < m; ++i) {
			b = scan.nextInt();
			vector[i] = b;
		}
		/**
		 * ?¨???? n*m???????????¨m*1????????????????????????n*1????§£????±?????????????
		 */
			for (int d = 0; d < n; ++d) {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		}

	}
} public class Main {

	public static void main(String[] args) {
		int n = 0, m = 0;
		int b = 0;
		int temp1 = 0;
		int temp2 = 0;
		int sum = 0;
		int count1 = 0;
		int count2 = 0;
		String str;
		ArrayList<String> st = new ArrayList<String>(); // ??\?????????????????????b,f,r,v
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????
		/**
		 * ???????????\???(n*m??????)
		 */
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt(); // n,m????±????
		m = scan.nextInt();
		int matrix[][] = new int[n][m];
		int vector[] = new int[m];
		int anser[] = new int[n];
		// System.out.println(n+" "+m);
		for (int a = 0; a < n; ++a) { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		}
		for (int k = 0; k < n; ++k) { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		}
		/**
		 * ???????????\???(m*1????????????)
		 */
		for (int i = 0; i < m; ++i) {
			b = scan.nextInt();
			vector[i] = b;
		}
		/**
		 * ?¨???? n*m???????????¨m*1????????????????????????n*1????§£????±?????????????
		 */
			for (int d = 0; d < n; ++d) {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		}

	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int n = 0, m = 0;
		int b = 0;
		int temp1 = 0;
		int temp2 = 0;
		int sum = 0;
		int count1 = 0;
		int count2 = 0;
		String str;
		ArrayList<String> st = new ArrayList<String>(); // ??\?????????????????????b,f,r,v
		ArrayList<Integer> parse = new ArrayList<Integer>(); // int??????
		/**
		 * ???????????\???(n*m??????)
		 */
		Scanner scan = new Scanner(System.in);
		n = scan.nextInt(); // n,m????±????
		m = scan.nextInt();
		int matrix[][] = new int[n][m];
		int vector[] = new int[m];
		int anser[] = new int[n];
		// System.out.println(n+" "+m);
		for (int a = 0; a < n; ++a) { // ??\?????¶??°????????????
			for (int t = 0; t < m; ++t) { // ??\??????????????????????????????????????????????´?
				st.add(scan.next());
			}
			for (int p = count1; p < st.size(); ++p) { // String???Int??????
				str = st.get(p);
				temp1 = Integer.parseInt(str);
				parse.add(temp1);
				//System.out.println("parse[" + p + "] = " + parse.get(p));
			}
			count1 += m;
		}
		for (int k = 0; k < n; ++k) { // n*m??????????????????????????\
			for (int l = 0; l < m; ++l) {
				matrix[k][l] = parse.get(count2++);
				//System.out.println("matrix[" + k + "][" + l + "] : " + matrix[k][l]);
			}
		}
		/**
		 * ???????????\???(m*1????????????)
		 */
		for (int i = 0; i < m; ++i) {
			b = scan.nextInt();
			vector[i] = b;
		}
		/**
		 * ?¨???? n*m???????????¨m*1????????????????????????n*1????§£????±?????????????
		 */
			for (int d = 0; d < n; ++d) {
				for (int f = 0; f < m; ++f) {
					sum += matrix[d][f] * vector[f];
				}
				anser[d] = sum;
				System.out.println(anser[d]);
				sum = 0;
		}

	}
}