#include<cstdio>
int r,c,n,x,y,t,a[10001],b[101][101];
int main()
{
	scanf("%d%d%d",&r,&c,&n);
	for (int i=1;i<=n;i++)scanf("%d",&a[i]);
	x=y=t=1;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=a[i];j++)
		{
			b[x][y]=i;
			y+=t;
			if ((y>c)||(y<1))
			{
				t=0-t;
				x++;
				if (t==-1)y=c;
				else y=1;
			}
		}
	for (int i=1;i<=r;i++)
	{
		for (int j=1;j<=c;j++)printf("%d ",b[i][j]);
		printf("\n");
	}
}