import java.io.{BufferedReader, InputStream, InputStreamReader}
import java.util.StringTokenizer

import scala.util.Sorting

object Main {

  val MOD = 1000000007

  def solve(): Unit = {
    val sc = new FastScanner(System.in)
    val H = sc.nextInt
    val W = sc.nextInt
    val N = sc.nextInt
    val a = Array.ofDim[(Int, Int)](N)
    (0 until N) foreach { i =>
      a(i) = (i + 1, sc.nextInt)
    }
    Sorting.quickSort(a)(Ordering.by((_: (Int, Int))._2))
    var cur = 0
    (0 until H) foreach { h =>
      val row = ((0 until W) map { _ =>
        if (a(cur)._2 == 0) cur += 1
        val i = a(cur)._1
        a(cur) = (i, a(cur)._2 - 1)
        i
      }).mkString(" ")
      println(if ((h & 1) == 0) row else row.reverse)
    }
  }

  def main(args: Array[String]): Unit = {
    solve()
  }

  class FastScanner(val stream: InputStream) {
    val in = new BufferedReader(new InputStreamReader(stream))
    var st: StringTokenizer = _

    def next: String = {
      while (st == null || !st.hasMoreTokens) {
        val rl = in.readLine
        if (rl == null) return null
        st = new StringTokenizer(rl)
      }
      st.nextToken
    }

    def nextInt: Int = next.toInt
  }
}
