object Main {
  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)
    val n = scanner.nextInt()
    val m = scanner.nextInt()

    val a = Array.ofDim[Int](n, m)
    val b = new Array[Int](m)
    for {
      i <- 0 until n
      j <- 0 until m
    } {
      a(i)(j) = scanner.nextInt()
    }
    for (j <- 0 until m) {
      b(j) = scanner.nextInt()
    }

    a.map(_.zip(b).map { case (a, b) => a * b }.sum)
      .foreach(println)
  }
}