""" 端を考えると 36以下は無理 角と、その隣が調和している必要がある ABXAB BAXBA XXXX ABXA ABXAB CDXCD XXXXX ABXAB CDXCD 探索した方がいい? 9**4 """ import sys def sol(ans): for i in range(H): for j in range(W): now = 0 for x in range(i-1,i+2): for y in range(j-1,j+2): if 0 <= x < H and 0 <= y < W: now += ans[x][y] if now != X: return False for i in ans: print (*i) sys.exit() W,H,X = map(int,input().split()) ans = [[0] * W for i in range(H)] # type1 for A in range(10): for i in range(H): for j in range(W): if i % 3 == 1: ans[i][j] = A else: ans[i][j] = 0 sol(ans) for A in range(10): for i in range(H): for j in range(W): if j % 3 == 1: ans[i][j] = A else: ans[i][j] = 0 sol(ans) #type3 for A in range(10): for i in range(H): for j in range(W): if i % 3 == j % 3 == 1: ans[i][j] = A else: ans[i][j] = 0 sol(ans) #type2 for A in range(10): for B in range(10): for C in range(10): for D in range(10): if A+B+C+D == X: for i in range(H): for j in range(W): if i % 3 == 2 or j % 3 == 2: ans[i][j] = 0 elif i % 3 == j % 3 == 0: ans[i][j] = A elif i % 3 == 0 and j % 3 == 1: ans[i][j] = B elif i % 3 == 1 and j % 3 == 0: ans[i][j] = C else: ans[i][j] = D sol(ans) print (-2) sys.exit() #print (ans) print (-1) """ if X == 0: for i in ans: print (*i) elif W == H == 1: if 0 <= X <= 9: print (X) else: print (-1) elif H == 1: if W % 3 != 2 or X >= 18: print (-1) else: if X % 4 != 0 or X: """