object Main {
    def main(args: Array[String]) {
        val sc = new java.util.Scanner(System.in)
        val h, w, n = sc.nextInt
        var a = List[Int]()
        for (i <- 1 to n) {
            val c = sc.nextInt
            for (j <- 1 to c) a = i :: a
        }
        val table = Array.fill(h, w)(-1)
        for (i <- 0 until h) {
            for (j <- 0 until w) {
                val idx = if (i%2 == 0) j else w - j - 1
                table(i)(idx) = a.head
                a = a.tail
            }
        }
        for (i <- 0 until h) {
            for (j <- 0 until w) {
                if (j!=0) print(" ")
                print(table(i)(j))
            }
            println()
        }
    }
}