#include <iostream>
#include <cstdio>
#define N 105
using namespace std;

int h, w, n, a, x, y, dx = 1, ans[N][N];
int main()
{
	int i, j;
	cin >> h >> w >> n;
	for (i = j = 0; i < h * w; i++, a--) {
		if (a == 0) scanf("%d", &a), j++;
		ans[y][x] = j;
		x += dx;
		if (x < 0 || x == w) dx = -dx, x += dx, y++;
	}
	for (i = 0; i < h; i++, puts("")) for (j = 0; j < w; j++) printf("%d ", ans[i][j]);
    return 0;
}