#include using namespace std; #define rep(i,n) for(ll i=0;i=0;i--) #define perl(i,r,l) for(ll i=r-1;i>=l;i--) #define fi first #define se second #define pb push_back #define ins insert #define pqueue(x) priority_queue,greater> #define all(x) (x).begin(),(x).end() #define CST(x) cout<; using vvl=vector>; using pl=pair; using vpl=vector; using vvpl=vector; const ll MOD=1000000007; const ll MOD9=998244353; const int inf=1e9+10; const ll INF=4e18; const ll dy[8]={-1,0,1,0,1,1,-1,-1}; const ll dx[8]={0,-1,0,1,1,-1,1,-1}; template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } ll h,w,x; vvl ans; void dfs(vvl &g){ rep(i,h){ rep(j,w){ if(g[i][j]==-1){ for(int k=0;k<=9;k++){ g[i][j]=k; g[i][w-j-1]=k; g[h-i-1][j]=k; g[h-i-1][w-j-1]=k; dfs(g); } g[i][j]=-1; g[i][w-j-1]=-1; g[h-i-1][j]=-1; g[h-i-1][w-j-1]=-1; return; } } } bool ok=true; rep(i,h){ rep(j,w){ ll p=g[i][j]; rep(k,8){ ll nx=i+dx[k],ny=j+dy[k]; if(nx<0||ny<0||nx>=h||ny>=w)continue; p+=g[nx][ny]; } if(p!=x)ok=false; } } if(ok)ans=g; return ; } void dfs2(vvl &g){ rep(i,h){ rep(j,w){ if(g[i][j]==-1){ for(int k=0;k<=9;k++){ g[i][j]=k; dfs2(g); } g[i][j]=-1; return; } } } bool ok=true; rep(i,h){ rep(j,w){ ll p=g[i][j]; rep(k,8){ ll nx=i+dx[k],ny=j+dy[k]; if(nx<0||ny<0||nx>=h||ny>=w)continue; p+=g[nx][ny]; } if(p!=x)ok=false; } } if(ok)ans=g; return; } int main(){ cin >> w >>h >> x; if(x==0){ rep(i,h){ rep(j,w)cout << 0; cout << endl; } return 0; } if(h>=6||w>=6){ if(x>=10)cout << -1 <=h||ny>=w)continue; p+=g[nx][ny]; } if(p!=x)ok=false; } } if(ok){ rep(i,h){ rep(j,w)cout << g[i][j];cout << endl; } } else cout << -1 <{0,h-1}){ for(auto y:vector{0,w-1}){ for(int i=-2;i<=2;i++){ for(int j=-2;j<=2;j++){ if(abs(i)==2||abs(j)==2){ if(x+i<0||x+i>=h||y+j<0||y+j>=w)continue; g[x+i][y+j]=0; } } } } } if(h<=2&&w<=2){ dfs2(g); if(ans.size()==h){ rep(i,h){ rep(j,w)cout << ans[i][j]; cout << endl; } } else cout << -1 <