from collections import Counter,defaultdict,deque

import sys,heapq,bisect,math,itertools,string,queue

sys.setrecursionlimit(10**8)

mod = 10**9+7

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



h,w = inpl()

n = inp()

a = inpl()

q = deque(a)

tmp = q.popleft()

cnt = 1

res = [[0 for i in range(w)] for j in range(h)]

for y in range(h):

    for x in range(w):

        if y%2:

            x = w - x - 1

        if tmp == 0:

            tmp = q.popleft()

            cnt += 1

        res[y][x] = cnt

        tmp -= 1

for y in range(h):

    for x in range(w):

        print((res[y][x]))
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



h,w = inpl()

n = inp()

a = inpl()

ind = 0

now = a[0]

res = [[None]*w for _ in range(h)]

for i in range(h):

    for j in range(w):

        res[i][j] = ind+1

        now -= 1

        if now == 0 and ind < n-1:

            ind += 1

            now = a[ind]

for i in range(h):

    if i%2:

        tmp = [str(x) for x in res[i][::-1]]

    else:

        tmp = [str(x) for x in res[i]]  

    print((' '.join(tmp)))
from collections import Counter, defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue

sys.setrecursionlimit(10**8)
mod = 10**9 + 7


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpl_str():
    return list(sys.stdin.readline().split())


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


h, w = inpl()
n = inp()
a = inpl()
q = deque(a)
tmp = q.popleft()
cnt = 1
res = [[0 for i in range(w)] for j in range(h)]
for y in range(h):
    for x in range(w):
        if y % 2:
            x = w - x - 1
        if tmp == 0:
            tmp = q.popleft()
            cnt += 1
        res[y][x] = cnt
        tmp -= 1
for y in range(h):
    for x in range(w):
        print((res[y][x]))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


h, w = inpl()
n = inp()
a = inpl()
ind = 0
now = a[0]
res = [[None] * w for _ in range(h)]
for i in range(h):
    for j in range(w):
        res[i][j] = ind + 1
        now -= 1
        if now == 0 and ind < n - 1:
            ind += 1
            now = a[ind]
for i in range(h):
    if i % 2:
        tmp = [str(x) for x in res[i][::-1]]
    else:
        tmp = [str(x) for x in res[i]]
    print((" ".join(tmp)))

-import sys, heapq, bisect, math, itertools, string, queue +from heapq import heappop, heappush, heapify +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint +INF = float("inf") -def inpl_str(): -    return list(sys.stdin.readline().split()) - - -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -q = deque(a) -tmp = q.popleft() -cnt = 1 -res = [[0 for i in range(w)] for j in range(h)] -for y in range(h): -    for x in range(w): -        if y % 2: -            x = w - x - 1 -        if tmp == 0: -            tmp = q.popleft() -            cnt += 1 -        res[y][x] = cnt -        tmp -= 1 -for y in range(h): -    for x in range(w): -        print((res[y][x])) +ind = 0 +now = a[0] +res = [[None] * w for _ in range(h)] +for i in range(h): +    for j in range(w): +        res[i][j] = ind + 1 +        now -= 1 +        if now == 0 and ind < n - 1: +            ind += 1 +            now = a[ind] +for i in range(h): +    if i % 2: +        tmp = [str(x) for x in res[i][::-1]] +    else: +        tmp = [str(x) for x in res[i]] +    print((" ".join(tmp)))