#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
  int h, w;
  cin >> h >> w;
  int n;
  cin >> n;
  vector<int> vs;
  for (int i = 1; i <= n; i++)
  {
	int v;
	cin >> v;
	for (int j = 0; j < v; j++)
	{
	  vs.push_back(i);
	}
  }
  for (int j = 0; j < h; j++)
  {
	for (int i = 0; i < w; i++)
	{
	  int index = (j % 2 == 0 ? j * w + i : j * w + (w - 1 - i));
	  if (i > 0) cout << " ";
	  cout << vs[index];
	}
	cout << endl;
  }
}
