import scala.io.StdIn.{readLine,readInt}

object Main {

  def main(args: Array[String]) = {
    val d = readLine.split(" ").map(_.toInt)
    val m1 = Array.ofDim[Int](d(0),d(1))
    val m2:Array[Int] = new Array(d(1))

    0 until d(0) foreach { m1(_) = readLine.split(" ").map(_.toInt) }
    0 until d(1) foreach { m2(_) = readInt() }

    m1.foreach { e => println(e.zip(m2).foldLeft(0) { (x,y) => x + y._1*y._2 }) }
  }
}