object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val h, w, n = sc.nextInt()
  val as = List.fill(n)(sc.nextInt())
  val c = as.zipWithIndex.flatMap{case (a, idx) => List.fill(a)(idx+1)}
  c.sliding(w,w).zipWithIndex.foreach{ case (r0, idx) =>
    val r = if (idx % 2 == 0) r0 else r0.reverse
    println(r.mkString(" "))
  }
}
