#include<stdio.h>
int main()
{   
	int H, W, N,i,j,x,y,n=0,sum=0;
	int a[10000], b[10000] = {0}, HW[100][100] = { 0 };
	while ((scanf("%d%d",&H,&W))==2)
	{
		scanf("%d", &N);
		for (i = 0; i < N; i++)
			scanf("%d", &a[i]);
		for (i = 0; i < N; i++)
		{
			for (j = 0; j < a[i]; j++)
				b[n++] = i+1;
		}
		n = 1; HW[x = 0][y = W - 1] = 1;
		while (b[n])
		{
			while (x + 1 < H && !HW[x + 1][y])
				HW[++x][y] = b[n++];
			while (y - 1 >= 0 && !HW[x][y - 1])
				HW[x][--y] = b[n++];
			while (x - 1 >= 0 && !HW[x - 1][y])
				HW[--x][y] = b[n++];
			while (y + 1 < n && !HW[x][y + 1])
				HW[x][++y] = b[n++];
		}
		for (i = 0; i < H; i++)
		{
			for (j = 0; j < W; j++)
			{
				printf("%d ", HW[i][j]);
			}
			printf("\n");
		}
	}
	return 0;
}