object Main extends App {
  val scanner = new java.util.Scanner(System.in)
  val n = scanner.nextInt()
  val m = scanner.nextInt()

  val anm = (1 to n).map { _ =>
    (1 to m).map(_ => scanner.nextInt())
  }

  val bm = (1 to m).map(_ => scanner.nextInt())

  val cm = anm.map { am =>
    (am zip bm).map {
      case (a, b) => a * b
    }.sum
  }

  cm.foreach(println)
}