import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 1_000_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "begin", long, "end");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    long h, w;
    scan(h, w);
    auto n = lread();
    auto a = aryread();
    auto table = new long[][](h, w);
    ulong h_iter, w_iter;
    foreach (i; iota(n))
    {
        while(a[i] > 0)
        {
            if((w_iter / w) % 2)
                table[h_iter][w  - 1 - (w_iter % w)] = i + 1;
            else
                table[h_iter][(w_iter % w)] = i + 1;
            
            w_iter++;
            if(w_iter % w == 0)
                h_iter++;
            a[i]--;
        }
    }
    foreach (e; table)
    {
        foreach (f; e)
            writef("%s ", f);
        writeln();
    }
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}
