class Vector(val n:Int) {
    val elems = (1..n).map{_ -> 0}.toMutableList()

    operator fun get(index: Int) = elems[index]
    operator fun set(index: Int, value: Int) = elems.set(index, value)
}

class Matrix(val m:Int, val n:Int) {
    val elems = (1..n).map {_ -> (1..m).map {_ -> 0}.toMutableList()}.toMutableList()

    operator fun get(row:Int, column:Int) = elems[row][column]
    operator fun set(row:Int, column: Int, value:Int) = elems[row].set(column, value)
}

fun main(args: Array<String>) {
    var inStr = readLine() ?: return
    val (n, m) = inStr.split(' ').map { e -> e.toInt() }

    val matrixA = Matrix(m, n)
    val vecB = Vector(m)

    for (i in 0..n - 1) {
        inStr = readLine() ?: return
        val rowOfA = inStr.split(' ').map { e -> e.toInt() }

        for (j in 0..m - 1) {
            matrixA[i, j] = rowOfA[j]
        }
    }
    for (i in 0..m - 1) {
        inStr = readLine() ?: return

        val ele = inStr.toInt()

        vecB[i] = ele
    }

    val vecC = Vector(n)
    for (i in 0..n - 1) {
        var cValue = 0
        for (j in 0..m - 1) {
            cValue += matrixA[i, j] * vecB[j]
        }
        vecC[i] = cValue
    }

    for (i in vecC.elems) {
        println(i)
    }
}

