import java.util.Scanner;

public class Main
{

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int m = in.nextInt();
		int n = in.nextInt();
		int[][] A = new int[m][n];
		int b;
		for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		}
		
	
		for (int j = 0; j < n; j++)
		{
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		}
		for (int i = 0; i < m; i++)
		{   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		}

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

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int m = in.nextInt();
		int n = in.nextInt();
		int[][] A = new int[m][n];
		int b;
		for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		}
		
	
		for (int j = 0; j < n; j++)
		{
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		}
		for (int i = 0; i < m; i++)
		{   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		}

	}
} Main public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int m = in.nextInt();
		int n = in.nextInt();
		int[][] A = new int[m][n];
		int b;
		for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		}
		
	
		for (int j = 0; j < n; j++)
		{
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		}
		for (int i = 0; i < m; i++)
		{   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		}

	} main {
		Scanner in = new Scanner(System.in);
		int m = in.nextInt();
		int n = in.nextInt();
		int[][] A = new int[m][n];
		int b;
		for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		}
		
	
		for (int j = 0; j < n; j++)
		{
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		}
		for (int i = 0; i < m; i++)
		{   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		}

	} Scanner in = new Scanner(System.in); in new Scanner(System.in) int m = in.nextInt(); m in.nextInt() in.nextInt in int n = in.nextInt(); n in.nextInt() in.nextInt in int[][] A = new int[m][n]; A new int[m][n] m n int b; b for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		} {
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		} for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
				int a=in.nextInt();
				A[i][j] = a;
			} {
				int a=in.nextInt();
				A[i][j] = a;
			} int a=in.nextInt(); a in.nextInt() in.nextInt in A[i][j] = a A[i][j] A[i] A i j a for (int j = 0; j < n; j++)
		{
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		} {
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		} b = in.nextInt() b in.nextInt() in.nextInt in for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {
				A[i][j] *= b;
			} {
				A[i][j] *= b;
			} A[i][j] *= b A[i][j] A[i] A i j b for (int i = 0; i < m; i++)
		{   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		} int i = 0; int i = 0; i 0 i < m i m i++ i++ i {   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		} {   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		} int a=0; a 0 for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
				a+=A[i][j];
				//System.out.println(A[i][j]);
			} {
				a+=A[i][j];
				//System.out.println(A[i][j]);
			} a+=A[i][j] a A[i][j] A[i] A i j System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main
{

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int m = in.nextInt();
		int n = in.nextInt();
		int[][] A = new int[m][n];
		int b;
		for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		}
		
	
		for (int j = 0; j < n; j++)
		{
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		}
		for (int i = 0; i < m; i++)
		{   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		}

	}
} public class Main
{

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int m = in.nextInt();
		int n = in.nextInt();
		int[][] A = new int[m][n];
		int b;
		for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		}
		
	
		for (int j = 0; j < n; j++)
		{
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		}
		for (int i = 0; i < m; i++)
		{   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		}

	}
} Main
import java.util.Scanner;

public class Main
{

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int m = in.nextInt();
		int n = in.nextInt();
		int[][] A = new int[m][n];
		int b;
		for (int i = 0; i < m; i++)
		{
			for (int j = 0; j < n; j++)
			{
				int a=in.nextInt();
				A[i][j] = a;
			}
		}
		
	
		for (int j = 0; j < n; j++)
		{
			b = in.nextInt();
			for (int i = 0; i < m; i++)
			{
				A[i][j] *= b;
			}
		}
		for (int i = 0; i < m; i++)
		{   int a=0;
			for (int j = 0; j < n; j++)
			{
				a+=A[i][j];
				//System.out.println(A[i][j]);
			}
			System.out.println(a);
		}

	}
}