import scala.io.Source

object Main extends App {
  val input = Source.stdin.getLines.map(_.split(" ").toList.map(_.toInt)).toList

  val matrixA: List[List[Int]] = input.tail.dropRight(input(0)(1))
  val vectorB: List[Int] = input.drop(input(0)(0)+1).flatten

  println((for {
    line <- matrixA
    i <- 0 to input(0)(1)-1
  } yield { line(i) * vectorB(i) }).sliding(input(0)(1), input(0)(1)).toList.map(_.sum).mkString("\n"))
}