#include<bits/stdc++.h>


int arr[110][110];
int cnt[11000];
int main() {
	int h, w;
	scanf("%d%d", &h, &w);
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &cnt[i]);
	}
	int idx = 1;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			while (cnt[idx] == 0)idx++;
			arr[i][j] = idx;
			cnt[idx]--;
		}
	}
	for (int i = 1; i < h; i += 2) {
		std::reverse(arr[i], arr[i] + w);
	}
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			printf("%d ", arr[i][j]);
		}
		printf("\n");
	}
}