import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.range;

void main()
{
    int[] hw = readln().chomp().split(" ").map!(to!int).array();
    int h = hw[0],
        w = hw[1];
    int n = readln().chomp().to!int;
    auto as = readln().chomp().splitter(' ').map!(to!int).array();

    int cnt;
    int iy, ix;
    int di = 0;
    int[2][] dyx = [[0, 1], [1, 0], [0, -1], [-1, 0]];
    int[][] field = new int[][](h, w);
    foreach(int i, a; as){
        foreach(_; 0 .. a){
            field[iy][ix] = i+1;
            iy += dyx[di % $][0];
            ix += dyx[di % $][1];
            if(iy < 0 || ix < 0 || iy >= h || ix >= w || field[iy][ix] != 0){
                iy -= dyx[di % $][0];
                ix -= dyx[di % $][1];
                di += 1;
                iy += dyx[di % $][0];
                ix += dyx[di % $][1];
            }
        }

        ++cnt;
    }

    writefln("%(%(%s %)\n%)", field);
}