// arc080_b.cc
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	int h, w, n;
	cin >> h >> w >> n;
	vector<int> a(n);
	for (auto& e : a)
		cin >> e;

	vector<vector<int>> ans(h, vector<int>(w));

	int k = 0;
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			int jj = i % 2 == 0 ? j : w - 1 - j;
			if (a[k] == 0) k++;
			ans[i][jj] = k + 1;
			a[k]--;
		}
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cout << ans[i][j] << " ";
		}
		cout << "\n";
	}
}