#include<bits/stdc++.h>
using namespace std;
const int N = 312;
int n,a[100001],h,w,ans[N][N];
int main()
{
	cin>>h>>w>>n;
	for(int i=1;i<=n;++i)cin>>a[i];
	int tmp=1;
	for(int i=1;i<=h;++i)
	for(int t=1;t<=w;++t)
	{
		a[tmp]--;
		ans[i][t]=tmp;
		if(a[tmp]==0)tmp++;
	}
	for(int i=1;i<=h;++i)
	{
		if(i%2)
		for(int t=1;t<=w;++t)
		cout<<ans[i][t]<<" ";
		else
		for(int t=w;t>=1;--t)
		cout<<ans[i][t]<<" ";
		
		cout<<endl;
	}
}