#include<iostream>
#include<vector>
using namespace std;

int main(){
  int h, w, n;
  cin >> h >> w >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  vector<vector<int>> c(h,vector<int>(w));
  int t=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(a[t]==0)t++;
      if(i%2) c[i][w-1-j]=t+1;
      else c[i][j]=t+1;
      a[t]--;
    }
    for(int j=0;j<w;j++){
      cout << c[i][j] << " ";
    }
    cout << endl;
  }
}