#include<iostream>
using namespace std;

int a[105][105];

int main() {
	int h, w, n; cin >> h >> w >> n;

	int w_cnt = 0, h_cnt = 0;
	bool rev = false;
	for (int i = 0; i < n; i++) {
		int tmp; cin >> tmp;

		while (tmp > 0) {
			if (w_cnt == w||w_cnt==-1){
				rev = !rev;
				h_cnt++;
				w_cnt += w_cnt == w ? -1 : 1;
			}
			a[h_cnt][w_cnt] = i + 1;
			tmp--;
			w_cnt += (!rev ? 1 : -1);
		}
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cout << a[i][j] << ' ';
		}
		cout << endl;
	}

	return 0;
}