W,H,X=map(int,input().split()) if H==W==1: print(X if X<=9 else -1) exit() elif H==1 and W==2: if X<=18: p=min(9,X) q=X-p print(p,q) else: print(-1) exit() elif H==2 and W==1: if X<=18: p=min(9,X) q=X-p print(p,q,sep="\n") else: print(-1) exit() Flag=1 K=(1 if H%3==2 else 0)+(1 if W%3==2 else 0) if K==0 and X>9: Flag=0 elif K==1 and X>18: Flag=0 elif K==2 and X>36: Flag=0 if Flag==0: print(-1) exit() P=[0]*4 Y=X for i in range(4): a=min(Y,9) P[i]=a Y-=a a,b,c,d=P h=H%3;w=W%3 if h==0: if w==0: Q=[[0,0,0],[0,a,0],[0,0,0]] elif w==1: Q=[[0,0,0],[a,0,0],[0,0,0]] else: Q=[[0,0,0],[a,b,0],[0,0,0]] elif h==1: if w==0: Q=[[0,a,0],[0,0,0],[0,0,0]] elif w==1: Q=[[a,0,0],[0,0,0],[0,0,0]] else: Q=[[a,b,0],[0,0,0],[0,0,0]] else: if w==0: Q=[[0,a,0],[0,b,0],[0,0,0]] elif w==1: Q=[[a,0,0],[b,0,0],[0,0,0]] else: Q=[[a,b,0],[c,d,0],[0,0,0]] R=[("{}{}{}".format(x[0],x[1],x[2]))*W for x in Q] for i in range(H): print(R[i%3][:W])