import sys

import numpy as np



h,w = [int(x) for x in sys.stdin.readline().split()]

n = int(eval(input()))

a = [int(x) for x in sys.stdin.readline().split()]

s = h*w



l = []



for i,x in enumerate(a):

	for j in range(x):

		l.append(i+1)



l = np.array(l).reshape((h,w))



for i,x in enumerate(l):

	if i % 2 == 0:

		print((' '.join(map(str, x))))

	else:

		print((' '.join(map(str, reversed(x)))))
h,w = list(map(int, input().split()))

n = int(eval(input()))

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



l = []



for i,x in enumerate(a):

	for j in range(x):

		l.append(i+1)



for i in range(h):

	t = l[i*w:(i+1)*w]

	if i % 2 == 1:

		t.reverse()

	print((' '.join(map(str, t))))
import sys
import numpy as np

h, w = [int(x) for x in sys.stdin.readline().split()]
n = int(eval(input()))
a = [int(x) for x in sys.stdin.readline().split()]
s = h * w
l = []
for i, x in enumerate(a):
    for j in range(x):
        l.append(i + 1)
l = np.array(l).reshape((h, w))
for i, x in enumerate(l):
    if i % 2 == 0:
        print((" ".join(map(str, x))))
    else:
        print((" ".join(map(str, reversed(x)))))

h, w = list(map(int, input().split()))
n = int(eval(input()))
a = list(map(int, input().split()))
l = []
for i, x in enumerate(a):
    for j in range(x):
        l.append(i + 1)
for i in range(h):
    t = l[i * w : (i + 1) * w]
    if i % 2 == 1:
        t.reverse()
    print((" ".join(map(str, t))))

-import sys -import numpy as np - -h, w = [int(x) for x in sys.stdin.readline().split()] +h, w = list(map(int, input().split())) -a = [int(x) for x in sys.stdin.readline().split()] -s = h * w +a = list(map(int, input().split())) -l = np.array(l).reshape((h, w)) -for i, x in enumerate(l): -    if i % 2 == 0: -        print((" ".join(map(str, x)))) -    else: -        print((" ".join(map(str, reversed(x))))) +for i in range(h): +    t = l[i * w : (i + 1) * w] +    if i % 2 == 1: +        t.reverse() +    print((" ".join(map(str, t))))