# 2019/09/09



from collections import deque



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

n=int(eval(input()))

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



res=[]

for i in range(n):

    res+=[i+1]*a[i]



res=deque(res)



for i in range(h):

    tmp=[]

    for j in range(w):

        tmp.append(res.popleft())

    if i%2:print((*tmp[::-1]))

    else:print((*tmp))
# https://atcoder.jp/contests/arc080/tasks/arc080_b



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

n = int(eval(input()))

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



hw=[]

for i in range(n):

    hw+=([str(i+1)]*a[i])



flag = False

for i in range(h):

    bgn=i*w

    end=bgn+w

    res = hw[bgn:end]

    if flag:

        res=res[::-1]

        flag = False

    else:

        flag = True

    print((*res))
# 2019/09/09
from collections import deque

h, w = list(map(int, input().split()))
n = int(eval(input()))
a = list(map(int, input().split()))
res = []
for i in range(n):
    res += [i + 1] * a[i]
res = deque(res)
for i in range(h):
    tmp = []
    for j in range(w):
        tmp.append(res.popleft())
    if i % 2:
        print((*tmp[::-1]))
    else:
        print((*tmp))

# https://atcoder.jp/contests/arc080/tasks/arc080_b
h, w = list(map(int, input().split()))
n = int(eval(input()))
a = list(map(int, input().split()))
hw = []
for i in range(n):
    hw += [str(i + 1)] * a[i]
flag = False
for i in range(h):
    bgn = i * w
    end = bgn + w
    res = hw[bgn:end]
    if flag:
        res = res[::-1]
        flag = False
    else:
        flag = True
    print((*res))

-# 2019/09/09 -from collections import deque - +# https://atcoder.jp/contests/arc080/tasks/arc080_b -res = [] +hw = [] -    res += [i + 1] * a[i] -res = deque(res) +    hw += [str(i + 1)] * a[i] +flag = False -    tmp = [] -    for j in range(w): -        tmp.append(res.popleft()) -    if i % 2: -        print((*tmp[::-1])) +    bgn = i * w +    end = bgn + w +    res = hw[bgn:end] +    if flag: +        res = res[::-1] +        flag = False -        print((*tmp)) +        flag = True +    print((*res))