#include <bits/stdc++.h>

using namespace std;

int h, w, n, A[10050];
int grid[105][105];
int main(){
	cin >> h >> w >> n;
	for(int i = 1; i<=n; i++) cin >> A[i];
	int cur = 1;
	for(int i = 0; i<h; i++){
		if(i%2){
			for(int j = 0; j<w; j++){
				grid[i][j] = cur;
				A[cur]--;
				if(A[cur] == 0) cur++;
			}
		}else{
			for(int j = w-1; j>=0; j--){
				grid[i][j] = cur;
				A[cur]--;
				if(A[cur] == 0) cur++;
			}
		}
	}
	for(int i = 0; i<h; i++){ for(int j = 0; j<w; j++) cout << grid[i][j] << " "; cout << "\n"; }
}
