#include<bits/stdc++.h>

using namespace std;

typedef long long int64;
const int64 mod = 1e9 + 7;

int main()
{
  int H, W, N, A[10000];

  cin >> H >> W;
  cin >> N;
  for(int i = 0; i < N; i++) cin >> A[i];

  int tail = 0;
  for(int i = 0; i < H; i++) {
    vector< int > vec;
    for(int j = 0; j < W; j++) {
      vec.push_back(tail + 1);
      --A[tail];
      if(A[tail] == 0) ++tail;
    }
    if(i & 1) reverse(begin(vec), end(vec));
    for(auto& p : vec) cout << p << " ";
    cout << endl;
  }
}
