import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

import scala.annotation.tailrec

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))
    val Array(h, w) = in.readLine().split("\\s+").map(_.toInt)
    val n = in.readLine().toInt
    val as = in.readLine().split("\\s+").map(_.toInt)
    val grid = Array.ofDim[Int](h, w)

    @tailrec
    def coloring(totalCount: Int, as: List[(Int, Int)]): Unit = {
      val x = if (totalCount % (2 * w) < w) {
        totalCount % (2 * w)
      } else {
        w - 1 - totalCount % w
      }
      val y = totalCount / w

      as match {
        case (color, count) :: rest =>
          System.err.println(s"(${y})(${x}) = ${color}")
          grid(y)(x) = color
          if (count > 1) {
            coloring(totalCount + 1, (color, count - 1) :: rest)
          } else {
            coloring(totalCount + 1, rest)
          }
        case Nil =>
      }
    }

    coloring(0, as.zipWithIndex.map { case (a, index) =>
      (index + 1, a)
    }.toList)

    for (y <- 0 until h) {
      out.println(grid(y).mkString(" "))
    }

    out.flush()
  }
}