#include<iostream>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<string>
#include<vector>
#include<cstdio>
#include<cstring>
using namespace std;
int n,h,w,a[10001];
int ans[100][100];
int main(){
	cin>>h>>w>>n;
	int x=0,y=0,d=1;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		for(int j=1;j<=a[i];j++){
			ans[x][y]=i;
			x+=d;
			if(x==h||x==-1){
				y++;
				x-=d;
				d*=-1;
			}
		}
	}
	for(int i=0;i<h;i++)
		for(int j=0;j<w;j++)
			cout<<ans[i][j]<<(j==w-1?"\n":" ");
	
  return 0;
}
