
object Main {
  def main(args: Array[String]): Unit = {
    val line = scala.io.StdIn.readLine().split(" ").map(_.toInt)
    val n = line(0)
    val m = line(1)
    val A = Array.ofDim[Int](n, m)
    val b = Array.ofDim[Int](m)
    val ans = Array.ofDim[Int](n)

    for (i <- 0 until n) {
      A(i) = scala.io.StdIn.readLine().split(" ").map(_.toInt)
    }
    for (j <- 0 until m) {
      b(j) = scala.io.StdIn.readInt()
    }

    for (i <- 0 until n) {
      for (j <- 0 until m) {
        ans(i) += A(i)(j) * b(j)
      }
    }
    println(ans.mkString("\n"))
  }
}