import sys input = sys.stdin.readline W, H, X = map(int, input().split()) res = [[0] * W for _ in range(H)] if (H % 3) <= 1 or (W % 3) <= 1: if H >= 3 and W >= 3: if X > 9: print(-1) exit(0) for i in range(H): for j in range(W): if i % 3 == 1 and j % 3 == 1: res[i][j] = X elif H <= 2: if H == 1 and X > 9: print(-1) exit(0) if X > 18: print(-1) exit(0) u = min(9, X) d = max(0, X - u) for j in range(W): if j % 3 == 0: res[0][j] = u if H > 1: res[1][j] = d elif W <= 2: if W == 1 and W > 9: print(-1) exit(0) if X > 18: print(-1) exit(0) u = min(9, X) d = max(0, X - u) for i in range(H): if i % 3 == 0: res[i][0] = u if W > 1: res[i][1] = d else: if H >= 2 and W >= 2: if X > 36: print(-1) exit(0) unit = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] x = X for i in range(2): for j in range(2): unit[i][j] = min(9, x) x -= unit[i][j] for i in range(H): for j in range(W): res[i][j] = unit[i % 3][j % 3] elif H == 1: unit = [0] * 3 x = X for i in range(2): unit[i] = min(9, x) x -= unit[i] for i in range(W): res[0][i] = unit[i % 3] elif W == 1: unit = [0] * 3 x = X for i in range(2): unit[i] = min(9, x) x -= unit[i] for i in range(H): res[i][0] = unit[i % 3] #for i in range(H): print(*res[i]) def check(): for i in range(H): for j in range(W): t = 0 for u in range(max(0, i - 1), min(H, i + 2)): for v in range(max(0, j - 1), min(W, j + 2)): t += res[u][v] if t != X: return False return True if check() == False: res = [[0] * W for _ in range(H)] for i in range(H): for j in range(W): if i % 3 == 1 and j % 3 == 1: res[i][j] = min(9, X) if check() == False: print(-1) exit(0) for i in range(H): print("".join(list(map(str, res[i]))))