#include<bits/stdc++.h>
#define Rint register int
using namespace std;
const int N = 103;
int n, m, k, nowx, nowy, ans[N][N];
int main(){
	scanf("%d%d%d", &n, &m, &k); nowx = nowy = 1;
	for(Rint i = 1;i <= k;i ++){
		int x; scanf("%d", &x);
		while(x --){
			ans[nowx][nowy] = i;
			if((nowx & 1) && nowy == m || !(nowx & 1) && nowy == 1) ++ nowx;
			else if(nowx & 1) ++ nowy;
			else -- nowy;
		}
	}
	for(Rint i = 1;i <= n;i ++){
		for(Rint j = 1;j <= m;j ++)
			printf("%d ", ans[i][j]);
		putchar('\n');
	}
}