object Main extends App {
  val Seq(n, m) = readLine.split(' ').map(_.toInt).toList

  val mtxa = Array.ofDim[Int](n, m)

  for (i <- 0 until n) {
    mtxa(i) = readLine.split(' ').map(_.toInt)
  }

  val vecb = for {
    j <- 0 until m
    bj = readLine.toInt
  } yield bj

  mtxa.foreach(veca => println(veca.zip(vecb).map(t=>t._1 * t._2).sum))
}

