object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt()
  val matrix = List.fill(n, m)(sc.nextInt())
  val vector = List.fill(m)(sc.nextInt())

  println(matrix.map(multiply(_, vector)).map(_.sum).mkString("\n"))

  def multiply(row: Seq[Int], vector: Seq[Int]): Seq[Int] = row.zip(vector).map(e => e._1 * e._2)
}