object Main extends App {
	
	override def main(args:Array[String]) = {
		val sc = new java.util.Scanner(System.in)
		
		val n = sc.nextInt
		val m = sc.nextInt
		
		var matrix = Array.ofDim[Int](n,m)
		var vector = new Array[Int](m)
		
		for(i <- (0 until n) ; j <- (0 until m)){
			matrix(i)(j) = sc.nextInt
		}
		
		for(j <- (0 until m)){
			vector(j) = sc.nextInt
		}
		
		val result = product(matrix, vector)
		for(i <- (0 until n)){
			println(result(i))
		}
	}
	
	def product(matrix: Array[Array[Int]] , vector: Array[Int]): Array[Int] ={
		val n = matrix.length
		val m = matrix(0).length
		
		var res = new Array[Int](n)
		
		for(i <- (0 until n)){
			var sum = 0
			for(j <- (0 until m)){
				sum = sum + matrix(i)(j) * vector(j)
			}
			res(i) = sum
		}
		res
	} 
}