#include<iostream>
#include<cstdio>
#include<algorithm>
#define N 1000
using namespace std;
int n,m;
int a[N][N];
int main(){
	scanf("%d %d",&n,&m);
	int t;
	scanf("%d",&t);
	int x=1,y=1;
	for (int i=1;i<=t;i++){
		int z;
		scanf("%d",&z);
		while (z--){
			a[x][y]=i;
			if (x&1)y++;
			else
				y--;
			if (y>m)y=m,x++;
			else
				if (!y)y=1,x++;
		}
	}
	for (int i=1;i<=n;i++){
		for (int j=1;j<m;j++)
			printf("%d ",a[i][j]);
		printf("%d",a[i][m]);
		if (i!=n)printf("\n");
	}
	return 0;
}