We have a grid with H rows and W columns of squares. Snuke is painting these squares in colors 1, 2, ..., N. Here, the following conditions should be satisfied:    * For each i (1 ≤ i ≤ N), there are exactly a_i squares painted in Color i. Here, a_1 + a_2 + ... + a_N = H W.   * For each i (1 ≤ i ≤ N), the squares painted in Color i are _4-connected_. That is, every square painted in Color i can be reached from every square painted in Color i by repeatedly traveling to a horizontally or vertically adjacent square painted in Color i.  Find a way to paint the squares so that the conditions are satisfied. It can be shown that a solution always exists.
h,w = map(int,input().split())
n = int(input())
L = list(map(int,input().split()))

li = [0 for i in range(h*w)]
for i in range(n):
    li[i] = L[i]
#print(L,li)
for i in range(h):
    print(*li[i*w:(i+1)*w])
h,w = map(int,input().split())
n = int(input())
L = list(map(int,input().split()))

li = []
for i in range(n):
    for j in range(L[i]):
        li.append((i+1))
#print(L,li)
l = h*w-len(li)
li = li + [0]*l
ans = []
for i in range(h):
    ans.append(li[i*w:(i+1)*w])

for i in range(h-1):
    if ans[i][-1] == ans[i+1][0]:
        ans[i+1] = ans[i+1][::-1]
#print(ans)
for i in range(h):
    print(*ans[i])