#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;
int a[MAXN];
int G[105][105];
int main() {
  int h, w;
  while (scanf("%d%d", &h, &w) != EOF) {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    int cnt = 1;
    for (int i = 1; i <= h; ++i) {
      if (i & 1) {
        for (int j = 1; j <= w; ++j) {
          if (a[cnt] > 0) {
            G[i][j] = cnt;
            --a[cnt];
          } else if (a[cnt] == 0) {
            ++cnt;
            G[i][j] = cnt;
            --a[cnt];
          }
        }
      } else {
        for (int j = w; j >= 1; --j) {
          if (a[cnt] > 0) {
            G[i][j] = cnt;
            --a[cnt];
          } else if (a[cnt] == 0) {
            ++cnt;
            G[i][j] = cnt;
            --a[cnt];
          }
        }
      }
    }
    for (int i = 1; i <= h; ++i) {
      for (int j = 1; j <= w; ++j) {
        if (j != w)
          printf("%d ", G[i][j]);
        else
          printf("%d\n", G[i][j]);
      }
    }
  }
  return 0;
}
