import java.util.Scanner

fun main(args:Array<String>){

    val cin = Scanner(System.`in`)
    val n = cin.nextInt()
    val m = cin.nextInt()

    var mat = Array(n,{ Array<Int>(m,{0}) })
    var vec = Array<Int>(m,{0})
    var result:Int = 0

    for(i in 0..n-1){
	    for(j in 0..m-1){
	        mat[i][j] = cin.nextInt()
	    }
    }

    for(i in 0..m-1) vec[i] = cin.nextInt()

    for(i in 0..n-1){
	    for(j in 0..m-1){
	        result += mat[i][j] * vec[j]
	    }
	    println(result)
	    result = 0
    }
}


