object Main {

    def main(args: Array[String]): Unit = {
        val sc = new java.util.Scanner(System.in)

        val n, m = sc.nextInt
        val a = Array.fill(n, m)(sc.nextInt)
        val b = Array.fill(m)(sc.nextInt)
        val c = Array.fill(n)(0)

        for( i <- 0 until n ) {
            for( j <- 0 until m ) {
                c(i) += a(i)(j)*b(j) 
            }
        }

        c.foreach(println)
    }
}

