#include<stdio.h>

int number_a[105][105],number_b[10050];

int main ()
{
    int H,M;
    while(scanf("%d %d",&H,&M)!=EOF)
    {
        int i,j,t,k=0;
        scanf("%d",&t);
        for(i=0; i<t; i++)
            scanf("%d",&number_b[i]);
        for(i=0; i<H; i++)
        {
            if(i%2==0)
                for(j=0; j<M; j++)
                {
                    number_a[i][j]=k+1;
                    number_b[k]--;
                    if(number_b[k]==0)
                        k++;
                }
            if(i%2==1)
                for(j=M-1; j>=0; j--)
                {
                    number_a[i][j]=k+1;
                    number_b[k]--;
                    if(number_b[k]==0)
                        k++;
                }
        }
        for(i=0; i<H; i++)
        {
            for(j=0; j<M-1; j++)
                printf("%d ",number_a[i][j]);
            printf("%d\n",number_a[i][M-1]);
        }
    }
}
