local H, W = io.read("n","n")
local N = io.read("n")
local A = {}
for i=1,N do
    A[i] = io.read("n")
end
local dir = 1
local i,j = 1,1
local c = 1
local p = {}
for k=1,H*W do
    p[j] = c
    A[c] = A[c] - 1
    if A[c] == 0 then
        c = c + 1
    end
    j = j + dir
    if j > W or j <= 0 then
        print(table.concat(p, " "))
        i = i + 1
        dir = -1 * dir
        j = j + dir
    end
end
