/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_6_D
  * Array - Matrix Vector Multiplication
  */
object Main {
  def main(args: Array[String]): Unit = {
    val Array(n, m) = io.StdIn.readLine().split(" ").map(_.toInt)
    val matrix = Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).take(n)
      .map(_.split(" ").map(_.toInt))
      .toVector // (.toSeq returns a lazy Stream)
    val vector = Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).take(m)
      .map(_.toInt)
      .toVector
    matrix.map(_.zip(vector).foldLeft(0)((acc, x) => acc + (x._1 * x._2)))
      .foreach(println)
  }
}