h,w,n,*A=list(map(int,open(0).read().split()));c=[]

for i in range(1,n+1):c+=[i]*A[i-1]

for i in range(h):print((*(c[i*w:-~i*w])[::(-1)**i]))
h,w,n,*A=list(map(int,open(0).read().split()));c=[]

for i in range(n):c+=[i+1]*A[i]

for i in range(h):print((*(c[i*w:-~i*w])[::(-1)**i]))
h, w, n, *A = list(map(int, open(0).read().split()))
c = []
for i in range(1, n + 1):
    c += [i] * A[i - 1]
for i in range(h):
    print((*(c[i * w : -~i * w])[:: (-1) ** i]))

h, w, n, *A = list(map(int, open(0).read().split()))
c = []
for i in range(n):
    c += [i + 1] * A[i]
for i in range(h):
    print((*(c[i * w : -~i * w])[:: (-1) ** i]))

-for i in range(1, n + 1): -    c += [i] * A[i - 1] +for i in range(n): +    c += [i + 1] * A[i]