#include using namespace std; //#define int long long #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair #define endl '\n' #define vec vector #define mat vector > #define fi first #define se second #define double long double typedef long long ll; typedef unsigned long long ull; typedef pair pll; //typedef long double ld; typedef complex Complex; const ll INF=1e9+7; const ll inf=INF*INF; const ll mod=1e9+7; const ll MAX=140010; int dx[]={-1,-1,-1,0,0,0,1,1,1}; int dy[]={-1,0,1,-1,0,1,-1,0,1}; signed main(){ cin.tie(0); ios::sync_with_stdio(false); ll w,h,x;cin>>w>>h>>x; vector >ans(h+2,vector(w+2,-1)); rep(i,h+2){ ans[i][0]=0; ans[i][w]=0; } rep(i,w+2){ ans[0][i]=0; ans[h][i]=0; } for(int i=h-3;i>=0;i--){ for(int j=w-1;j>=0;j--){ ans[i][j]=max(ans[i+3][j],ans[i][j]); } } for(int i=h-1;i>=0;i--){ for(int j=w-3;j>=0;j--){ ans[i][j]=max(ans[i][j+3],ans[i][j]); } } REP(i,1,h+1){ REP(j,1,w+1){ ll cnt=0; ll sum=0; rep(k,9){ ll nx=i+dx[k]; ll ny=j+dy[k]; if(ans[nx][ny]==-1){ cnt++; }else{ sum+=ans[nx][ny]; } } if(9LL*cnt>=x-sum){ ll d=x-sum; rep(k,9){ ll nx=i+dx[k]; ll ny=j+dy[k]; if(ans[nx][ny]==-1){ ll mi=min(d,9LL); ans[nx][ny]=mi; d-=mi; } } }else{ cout<<-1<