import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = line.split(" ");
		int v = Integer.parseInt(k[0]);// n
		int v2 = Integer.parseInt(k[1]);// m

		String[] n = new String[v];
		String[] m0 = new String[v2];
		int[] m = new int[v2];
		for (int i = 0; i < v; i++) {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		}
		for (int i = 0; i < v2; i++) {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		}
		for (int i = 0; i < n.length; i++) {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		}
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = line.split(" ");
		int v = Integer.parseInt(k[0]);// n
		int v2 = Integer.parseInt(k[1]);// m

		String[] n = new String[v];
		String[] m0 = new String[v2];
		int[] m = new int[v2];
		for (int i = 0; i < v; i++) {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		}
		for (int i = 0; i < v2; i++) {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		}
		for (int i = 0; i < n.length; i++) {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		}
	}

} Main public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = line.split(" ");
		int v = Integer.parseInt(k[0]);// n
		int v2 = Integer.parseInt(k[1]);// m

		String[] n = new String[v];
		String[] m0 = new String[v2];
		int[] m = new int[v2];
		for (int i = 0; i < v; i++) {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		}
		for (int i = 0; i < v2; i++) {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		}
		for (int i = 0; i < n.length; i++) {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		}
	} main {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = line.split(" ");
		int v = Integer.parseInt(k[0]);// n
		int v2 = Integer.parseInt(k[1]);// m

		String[] n = new String[v];
		String[] m0 = new String[v2];
		int[] m = new int[v2];
		for (int i = 0; i < v; i++) {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		}
		for (int i = 0; i < v2; i++) {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		}
		for (int i = 0; i < n.length; i++) {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] k = line.split(" "); k line.split(" ") line.split line " " int v = Integer.parseInt(k[0]); v Integer.parseInt(k[0]) Integer.parseInt Integer k[0] k 0 int v2 = Integer.parseInt(k[1]); v2 Integer.parseInt(k[1]) Integer.parseInt Integer k[1] k 1 String[] n = new String[v]; n new String[v] v String[] m0 = new String[v2]; m0 new String[v2] v2 int[] m = new int[v2]; m new int[v2] v2 for (int i = 0; i < v; i++) {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		} int i = 0; int i = 0; i 0 i < v i v i++ i++ i {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		} {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		} n[i] = sc.nextLine() n[i] n i sc.nextLine() sc.nextLine sc for (int i = 0; i < v2; i++) {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		} int i = 0; int i = 0; i 0 i < v2 i v2 i++ i++ i {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		} {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		} m0[i] = sc.nextLine() m0[i] m0 i sc.nextLine() sc.nextLine sc m[i] = Integer.parseInt(m0[i]) m[i] m i Integer.parseInt(m0[i]) Integer.parseInt Integer m0[i] m0 i for (int i = 0; i < n.length; i++) {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		} int i = 0; int i = 0; i 0 i < n.length i n.length n n.length i++ i++ i {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		} {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		} String[] gyou = n[i].split(" "); gyou n[i].split(" ") n[i].split n[i] n i " " int[] gyouv = new int[m.length]; gyouv new int[m.length] m.length m m.length for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			} int j = 0; int j = 0; j 0 j < gyou.length j gyou.length gyou gyou.length j++ j++ j {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			} {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			} gyouv[j] = Integer.parseInt(gyou[j]) gyouv[j] gyouv j Integer.parseInt(gyou[j]) Integer.parseInt Integer gyou[j] gyou j int sum = 0; sum 0 for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			} int j = 0; int j = 0; j 0 j < gyouv.length j gyouv.length gyouv gyouv.length j++ j++ j {
				sum += gyouv[j] * m[j];

			} {
				sum += gyouv[j] * m[j];

			} sum += gyouv[j] * m[j] sum gyouv[j] * m[j] gyouv[j] gyouv j m[j] m j System.out.println(sum) System.out.println System.out System System.out sum String[] arges arges public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = line.split(" ");
		int v = Integer.parseInt(k[0]);// n
		int v2 = Integer.parseInt(k[1]);// m

		String[] n = new String[v];
		String[] m0 = new String[v2];
		int[] m = new int[v2];
		for (int i = 0; i < v; i++) {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		}
		for (int i = 0; i < v2; i++) {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		}
		for (int i = 0; i < n.length; i++) {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		}
	}

} public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = line.split(" ");
		int v = Integer.parseInt(k[0]);// n
		int v2 = Integer.parseInt(k[1]);// m

		String[] n = new String[v];
		String[] m0 = new String[v2];
		int[] m = new int[v2];
		for (int i = 0; i < v; i++) {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		}
		for (int i = 0; i < v2; i++) {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		}
		for (int i = 0; i < n.length; i++) {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		}
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		String[] k = line.split(" ");
		int v = Integer.parseInt(k[0]);// n
		int v2 = Integer.parseInt(k[1]);// m

		String[] n = new String[v];
		String[] m0 = new String[v2];
		int[] m = new int[v2];
		for (int i = 0; i < v; i++) {
			n[i] = sc.nextLine();// String??????n?????\??????????????¨???
		}
		for (int i = 0; i < v2; i++) {
			m0[i] = sc.nextLine();
			m[i] = Integer.parseInt(m0[i]);// int?????????????????????m?????\???
		}
		for (int i = 0; i < n.length; i++) {
			String[] gyou = n[i].split(" ");// ????????¨???n?????°??????
			int[] gyouv = new int[m.length];
			for (int j = 0; j < gyou.length; j++) {
				gyouv[j] = Integer.parseInt(gyou[j]);// 1????????°????????????
			}
			int sum = 0;
			for (int j = 0; j < gyouv.length; j++) {
				sum += gyouv[j] * m[j];

			}
			System.out.println(sum);

		}
	}

}