output_description: Print the number of blocks in K-city.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n m
attempt: #
  # 　　  ⋀_⋀
  # 　　  (･ω･)
  # .／ Ｕ ∽ Ｕ＼
  #  │＊　合　＊│
  #  │＊　格　＊│
  #  │＊　祈　＊│
  #  │＊　願　＊│
  #  │＊　　　＊│
  #      ￣
  #
  import sys
  
  input = sys.stdin.readline
  inf = float("inf")
  mod = 10**9 + 7
  
  
  def INT_(n):
      return int(n) - 1
  
  
  def MI():
      return map(int, input().split())
  
  
  def MF():
      return map(float, input().split())
  
  
  def MI_():
      return map(INT_, input().split())
  
  
  def LI():
      return list(MI())
  
  
  def LI_():
      return [int(x) - 1 for x in input().split()]
  
  
  def LF():
      return list(MF())
  
  
  def LIN(n: int):
      return [input() for _ in range(n)]
  
  
  def LLIN(n: int):
      return [LI() for _ in range(n)]
  
  
  def LLIN_(n: int):
      return [LI_() for _ in range(n)]
  
  
  def LLI():
      return [list(map(int, l.split())) for l in input()]
  
  
  def I():
      return int(input())
  
  
  def F():
      return float(input())
  
  
  def ST():
      return input().replace("\n", "")
  
  
  def main():
      H, W = MI()
      N = I()
      A = [(int(a), i) for i, a in enumerate(input().split(), start=1)]
      A.sort()
  
      stack = []
      for a, i in A:
          stack.extend([i] * a)
  
      ans = [[0] * W for _ in range(H)]
      for i in range(H):
          for j in range(W):
              c = stack.pop()
              if i % 2 == 0:
                  ans[i][j] = c
              else:
                  ans[i][W - 1 - j] = c
      for a in ans:
          print(*a)
  
  
  if __name__ == "__main__":
      main()
  
problem_description: Statement
  
  In _K-city_ , there are n streets running east-west, and m streets running
  north-south. Each street running east-west and each street running north-south
  cross each other. We will call the smallest area that is surrounded by four
  streets a block. How many blocks there are in K-city?
samples: [{"input": "3 4", "output": "6\n    \n\nThere are six blocks, as shown below:\n\n![9179be829dc9810539213537d4c7398c.png](https://atcoder.jp/img/abc069/9179be829dc9810539213537d4c7398c.png)\n\n* * *"}, {"input": "2 2", "output": "1\n    \n\nThere are one block, as shown below:\n\n![997bfafa99be630b54d037225a5c68ea.png](https://atcoder.jp/img/abc069/997bfafa99be630b54d037225a5c68ea.png)"}]