import java.util.*

fun main(args:Array<String>){
    val (h,w) = readLine()!!.split(" ").map{it.toInt()}
    val n = readLine()!!.toInt()
    var a = readLine()!!.split(" ").map{it.toInt()}.toIntArray()
    var ans = Array(h) {IntArray(w)}
    var itr = 0
    for(i in 0 until h){
        if(i % 2 == 0){
            for(j in 0 until w){
                if(a[itr] == 0) itr++
                ans[i][j] = itr + 1
                a[itr]--
            }
        }
        else{
            for(j in w - 1 downTo 0){
                if(a[itr] == 0) itr++
                ans[i][j] = itr + 1
                a[itr]--
            }
        }
    }
    for(i in 0 until h){
        print(ans[i][0])
        for(j in 1 until w){
            print(" " + ans[i][j].toString())
        }
        println()
    }
}
