h, w = list(map(int, input().split()))

n = int(eval(input()))

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



c = [[0 for _ in range(w)] for _ in range(h)]



num = 0

apos = 0

for pos in range(h * w):

    x = pos // w

    y = pos % w

    if x % 2 == 1:

        y = w - y - 1

    c[x][y] = apos + 1

    num += 1

    if alst[apos] == num:

        apos += 1

        num = 0

for lst in c:

    print((*lst))
h, w = list(map(int, input().split()))

n = int(eval(input()))

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

cnt = 0

pos = 0

rev = False

for i in range(h):

    ans = [0 for _ in range(w)]

    for j in range(w):

        if rev:

            ans[w - 1 - j] = pos + 1

        else:

            ans[j] = pos + 1

        cnt += 1

        if alst[pos] == cnt:

            cnt = 0

            pos += 1

    print((*ans))

    if rev:

        rev = False

    else:

        rev = True
h, w = list(map(int, input().split()))
n = int(eval(input()))
alst = list(map(int, input().split()))
c = [[0 for _ in range(w)] for _ in range(h)]
num = 0
apos = 0
for pos in range(h * w):
    x = pos // w
    y = pos % w
    if x % 2 == 1:
        y = w - y - 1
    c[x][y] = apos + 1
    num += 1
    if alst[apos] == num:
        apos += 1
        num = 0
for lst in c:
    print((*lst))

h, w = list(map(int, input().split()))
n = int(eval(input()))
alst = list(map(int, input().split()))
cnt = 0
pos = 0
rev = False
for i in range(h):
    ans = [0 for _ in range(w)]
    for j in range(w):
        if rev:
            ans[w - 1 - j] = pos + 1
        else:
            ans[j] = pos + 1
        cnt += 1
        if alst[pos] == cnt:
            cnt = 0
            pos += 1
    print((*ans))
    if rev:
        rev = False
    else:
        rev = True

-c = [[0 for _ in range(w)] for _ in range(h)] -num = 0 -apos = 0 -for pos in range(h * w): -    x = pos // w -    y = pos % w -    if x % 2 == 1: -        y = w - y - 1 -    c[x][y] = apos + 1 -    num += 1 -    if alst[apos] == num: -        apos += 1 -        num = 0 -for lst in c: -    print((*lst)) +cnt = 0 +pos = 0 +rev = False +for i in range(h): +    ans = [0 for _ in range(w)] +    for j in range(w): +        if rev: +            ans[w - 1 - j] = pos + 1 +        else: +            ans[j] = pos + 1 +        cnt += 1 +        if alst[pos] == cnt: +            cnt = 0 +            pos += 1 +    print((*ans)) +    if rev: +        rev = False +    else: +        rev = True