W, H, X = map(int, input().split()) ans = [[0]*(W+1) for _ in range(H+1)] x1 = [1, 1, 0, -1, -1, -1, 0, 1, 0] y1 = [0, 1, 1, 1, 0, -1, -1, -1, 0] def debag(): r = 0 for x in range(H): for y in range(W): sm = 0 for px, py in zip(x1, y1): cx = x+px; cy = y+py if 0<=cx 36: print(-1) elif H==W==1: if X > 9: print(-1) else: print(X) elif W == 1: if X > 9*W*2: print(-1) else: res = [min(X, 9), X-min(X, 9), 0] for i in range(H): print(res[i%3]) elif H == 1: if X > 9*H*2: print(-1) else: res = [min(X, 9), X-min(X,9), 0] for i in range(W): if i < W-1: print(res[i%3], end = '') else: print(res[i%3]) else: x = [] cnt = 0 for i in range(3): xx = [] for j in range(3): if j <2: xx.append(min(X, 9)) X -= min(X, 9) else: xx.append(0) cnt += xx.count(0) x.append(xx) if H%3 == 1 and W%3 == 1 and cnt != 8: print(-1) elif H%3 == 1 and W%3 == 2 and cnt <= 6: print(-1) elif H%3 == 2 and W%3 == 1 and cnt <= 6: print(-1) else: if W%3 == 1 and H%3 == 2: x[0][1], x[1][0] = x[1][0], x[0][1] for i in range(H): for j in range(W): ans[i][j] = x[i%3][j%3] ans[i].pop() print(*ans[i], sep = '') # print(debag())