#include<iostream>
using namespace std;
int s[10010];
int t[10010];
int main()
{
    int h, w;

    cin >> h >> w;

    int n;
    cin >> n;

    for (int j = 1; j <= n; j++)
    cin >> t[j];

    int mytemp = 1;
    int j = 1;
        for (int i = 1; i <= n; i++)
        {
            while (t[i] > 0)
            {
                s[j] = mytemp;
                j++;
                t[i]--;
            }
            mytemp++;
        }
    for (int i = 1; i <= h; i++)
    {
        if (i % 2 == 1)
        {
            for (int p = w*(i - 1) + 1; p <= i*w; p++)
            {
                cout << s[p] << " ";
            }
        if (i != h)
        cout << endl;
        }
        else if (i % 2 == 0)
        {
            for (int p = w*i; p >= w*(i - 1) + 1; p--)
            {
                cout << s[p] << " ";
            }
            if (i != h)
            cout << endl;
        }
    }
    return 0;
}