object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt
  val a = Array.fill(n, m){ sc.nextInt }
  val b = Array.fill(m){ sc.nextInt }
  a.map(_.zip(b).map(x => x._1 * x._2).sum).map(println)
}