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

public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		Scanner scan = new Scanner(System.in);
		
		//n??¨m???????????\?????????int????????°???????´???????
		String s = scan.nextLine();
		String[] ary = s.split(" ");
		int n = Integer.parseInt(ary[0]);
		int m = Integer.parseInt(ary[1]);
		
		//n???????????±???????´???????
		ArrayList<String> array = new ArrayList<String>();
		for(int i = 0; i < n; i++) {
			array.add(scan.nextLine());
		}
		
		ArrayList<Integer> data = new ArrayList<Integer>();
		for(int i = 0; i < m; i++) {
			data.add(scan.nextInt());
		}
		
		//int??????????????????2?¬?????????????????´???????
		int [][] intArray = new int[n][m];
		for(int i = 0; i < n; i++) {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		}
		
		int[] sum = new int[n];
		for(int i = 0; i < intArray.length; i++) {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		}
				
		for(int i = 0; i < n; i++) {
			System.out.println(sum[i]);
		}
	}

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

	public static void main(String[] args) throws java.lang.Exception
	{
		Scanner scan = new Scanner(System.in);
		
		//n??¨m???????????\?????????int????????°???????´???????
		String s = scan.nextLine();
		String[] ary = s.split(" ");
		int n = Integer.parseInt(ary[0]);
		int m = Integer.parseInt(ary[1]);
		
		//n???????????±???????´???????
		ArrayList<String> array = new ArrayList<String>();
		for(int i = 0; i < n; i++) {
			array.add(scan.nextLine());
		}
		
		ArrayList<Integer> data = new ArrayList<Integer>();
		for(int i = 0; i < m; i++) {
			data.add(scan.nextInt());
		}
		
		//int??????????????????2?¬?????????????????´???????
		int [][] intArray = new int[n][m];
		for(int i = 0; i < n; i++) {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		}
		
		int[] sum = new int[n];
		for(int i = 0; i < intArray.length; i++) {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		}
				
		for(int i = 0; i < n; i++) {
			System.out.println(sum[i]);
		}
	}

} Main public static void main(String[] args) throws java.lang.Exception
	{
		Scanner scan = new Scanner(System.in);
		
		//n??¨m???????????\?????????int????????°???????´???????
		String s = scan.nextLine();
		String[] ary = s.split(" ");
		int n = Integer.parseInt(ary[0]);
		int m = Integer.parseInt(ary[1]);
		
		//n???????????±???????´???????
		ArrayList<String> array = new ArrayList<String>();
		for(int i = 0; i < n; i++) {
			array.add(scan.nextLine());
		}
		
		ArrayList<Integer> data = new ArrayList<Integer>();
		for(int i = 0; i < m; i++) {
			data.add(scan.nextInt());
		}
		
		//int??????????????????2?¬?????????????????´???????
		int [][] intArray = new int[n][m];
		for(int i = 0; i < n; i++) {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		}
		
		int[] sum = new int[n];
		for(int i = 0; i < intArray.length; i++) {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		}
				
		for(int i = 0; i < n; i++) {
			System.out.println(sum[i]);
		}
	} main {
		Scanner scan = new Scanner(System.in);
		
		//n??¨m???????????\?????????int????????°???????´???????
		String s = scan.nextLine();
		String[] ary = s.split(" ");
		int n = Integer.parseInt(ary[0]);
		int m = Integer.parseInt(ary[1]);
		
		//n???????????±???????´???????
		ArrayList<String> array = new ArrayList<String>();
		for(int i = 0; i < n; i++) {
			array.add(scan.nextLine());
		}
		
		ArrayList<Integer> data = new ArrayList<Integer>();
		for(int i = 0; i < m; i++) {
			data.add(scan.nextInt());
		}
		
		//int??????????????????2?¬?????????????????´???????
		int [][] intArray = new int[n][m];
		for(int i = 0; i < n; i++) {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		}
		
		int[] sum = new int[n];
		for(int i = 0; i < intArray.length; i++) {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		}
				
		for(int i = 0; i < n; i++) {
			System.out.println(sum[i]);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.nextLine(); s scan.nextLine() scan.nextLine scan String[] ary = s.split(" "); ary s.split(" ") s.split s " " int n = Integer.parseInt(ary[0]); n Integer.parseInt(ary[0]) Integer.parseInt Integer ary[0] ary 0 int m = Integer.parseInt(ary[1]); m Integer.parseInt(ary[1]) Integer.parseInt Integer ary[1] ary 1 ArrayList<String> array = new ArrayList<String>(); array new ArrayList<String>() for(int i = 0; i < n; i++) {
			array.add(scan.nextLine());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			array.add(scan.nextLine());
		} {
			array.add(scan.nextLine());
		} array.add(scan.nextLine()) array.add array scan.nextLine() scan.nextLine scan ArrayList<Integer> data = new ArrayList<Integer>(); data new ArrayList<Integer>() for(int i = 0; i < m; i++) {
			data.add(scan.nextInt());
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			data.add(scan.nextInt());
		} {
			data.add(scan.nextInt());
		} data.add(scan.nextInt()) data.add data scan.nextInt() scan.nextInt scan int [][] intArray = new int[n][m]; intArray new int[n][m] n m for(int i = 0; i < n; i++) {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		} {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		} String str = array.get(i); str array.get(i) array.get array i String [] strAry = str.split(" "); strAry str.split(" ") str.split str " " for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			} int j = 0; int j = 0; j 0 j < strAry.length j strAry.length strAry strAry.length j++ j++ j {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			} {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			} intArray[i][j] = Integer.parseInt(strAry[j]) intArray[i][j] intArray[i] intArray i j Integer.parseInt(strAry[j]) Integer.parseInt Integer strAry[j] strAry j int[] sum = new int[n]; sum new int[n] n for(int i = 0; i < intArray.length; i++) {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		} int i = 0; int i = 0; i 0 i < intArray.length i intArray.length intArray intArray.length i++ i++ i {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		} {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		} for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			} int j = 0; int j = 0; j 0 j < intArray[i].length j intArray[i].length intArray[i] intArray i intArray[i].length j++ j++ j {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			} {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			} sum[i] = sum[i] + (intArray[i][j] * data.get(j)) sum[i] sum i sum[i] + (intArray[i][j] * data.get(j)) sum[i] sum i (intArray[i][j] * data.get(j)) intArray[i][j] intArray[i] intArray i j data.get(j) data.get data j for(int i = 0; i < n; i++) {
			System.out.println(sum[i]);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			System.out.println(sum[i]);
		} {
			System.out.println(sum[i]);
		} System.out.println(sum[i]) System.out.println System.out System System.out sum[i] sum i String[] args args public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		Scanner scan = new Scanner(System.in);
		
		//n??¨m???????????\?????????int????????°???????´???????
		String s = scan.nextLine();
		String[] ary = s.split(" ");
		int n = Integer.parseInt(ary[0]);
		int m = Integer.parseInt(ary[1]);
		
		//n???????????±???????´???????
		ArrayList<String> array = new ArrayList<String>();
		for(int i = 0; i < n; i++) {
			array.add(scan.nextLine());
		}
		
		ArrayList<Integer> data = new ArrayList<Integer>();
		for(int i = 0; i < m; i++) {
			data.add(scan.nextInt());
		}
		
		//int??????????????????2?¬?????????????????´???????
		int [][] intArray = new int[n][m];
		for(int i = 0; i < n; i++) {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		}
		
		int[] sum = new int[n];
		for(int i = 0; i < intArray.length; i++) {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		}
				
		for(int i = 0; i < n; i++) {
			System.out.println(sum[i]);
		}
	}

} public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		Scanner scan = new Scanner(System.in);
		
		//n??¨m???????????\?????????int????????°???????´???????
		String s = scan.nextLine();
		String[] ary = s.split(" ");
		int n = Integer.parseInt(ary[0]);
		int m = Integer.parseInt(ary[1]);
		
		//n???????????±???????´???????
		ArrayList<String> array = new ArrayList<String>();
		for(int i = 0; i < n; i++) {
			array.add(scan.nextLine());
		}
		
		ArrayList<Integer> data = new ArrayList<Integer>();
		for(int i = 0; i < m; i++) {
			data.add(scan.nextInt());
		}
		
		//int??????????????????2?¬?????????????????´???????
		int [][] intArray = new int[n][m];
		for(int i = 0; i < n; i++) {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		}
		
		int[] sum = new int[n];
		for(int i = 0; i < intArray.length; i++) {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		}
				
		for(int i = 0; i < n; i++) {
			System.out.println(sum[i]);
		}
	}

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

public class Main {

	public static void main(String[] args) throws java.lang.Exception
	{
		Scanner scan = new Scanner(System.in);
		
		//n??¨m???????????\?????????int????????°???????´???????
		String s = scan.nextLine();
		String[] ary = s.split(" ");
		int n = Integer.parseInt(ary[0]);
		int m = Integer.parseInt(ary[1]);
		
		//n???????????±???????´???????
		ArrayList<String> array = new ArrayList<String>();
		for(int i = 0; i < n; i++) {
			array.add(scan.nextLine());
		}
		
		ArrayList<Integer> data = new ArrayList<Integer>();
		for(int i = 0; i < m; i++) {
			data.add(scan.nextInt());
		}
		
		//int??????????????????2?¬?????????????????´???????
		int [][] intArray = new int[n][m];
		for(int i = 0; i < n; i++) {
			String str = array.get(i);
			String [] strAry = str.split(" ");
			for(int j = 0; j < strAry.length; j++) {
				intArray[i][j] = Integer.parseInt(strAry[j]);
			}
		}
		
		int[] sum = new int[n];
		for(int i = 0; i < intArray.length; i++) {
			for(int j = 0; j < intArray[i].length; j++) {
				sum[i] = sum[i] + (intArray[i][j] * data.get(j));
			}
		}
				
		for(int i = 0; i < n; i++) {
			System.out.println(sum[i]);
		}
	}

}