H, W = list(map(int, input().split()))

N = int(eval(input()))

A = list(map(int, input().split()))



tmp = []

for i, a in enumerate(A, start=1):

    tmp.extend([i] * a)



ans = []

rev = 0



add = []

for i in range(1, H * W + 1):

    add.append(tmp[i-1])

    if i % W == 0:

        if rev:

            add = add[::-1]

        ans.append(add)

        rev = 1 - rev

        add = []



for a in ans:

    print((*a))

H, W = list(map(int, input().split()))

N = int(eval(input()))

A = list(map(int, input().split()))

col = []

for i, a in enumerate(A, start=1):

    col.extend([i] * a)



grid = []

for h in range(H):

    x = col[h * W: (h + 1) * W]

    if h % 2 == 0:

        x.reverse()

    grid.append(x)



for g in grid:

    print((*g))
H, W = list(map(int, input().split()))
N = int(eval(input()))
A = list(map(int, input().split()))
tmp = []
for i, a in enumerate(A, start=1):
    tmp.extend([i] * a)
ans = []
rev = 0
add = []
for i in range(1, H * W + 1):
    add.append(tmp[i - 1])
    if i % W == 0:
        if rev:
            add = add[::-1]
        ans.append(add)
        rev = 1 - rev
        add = []
for a in ans:
    print((*a))

H, W = list(map(int, input().split()))
N = int(eval(input()))
A = list(map(int, input().split()))
col = []
for i, a in enumerate(A, start=1):
    col.extend([i] * a)
grid = []
for h in range(H):
    x = col[h * W : (h + 1) * W]
    if h % 2 == 0:
        x.reverse()
    grid.append(x)
for g in grid:
    print((*g))

-tmp = [] +col = [] -    tmp.extend([i] * a) -ans = [] -rev = 0 -add = [] -for i in range(1, H * W + 1): -    add.append(tmp[i - 1]) -    if i % W == 0: -        if rev: -            add = add[::-1] -        ans.append(add) -        rev = 1 - rev -        add = [] -for a in ans: -    print((*a)) +    col.extend([i] * a) +grid = [] +for h in range(H): +    x = col[h * W : (h + 1) * W] +    if h % 2 == 0: +        x.reverse() +    grid.append(x) +for g in grid: +    print((*g))