#include<bits/stdc++.h> using namespace std; int a[1005][1005]; int main(){ int n,m,k,w=1; cin>>n>>m>>k; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ a[i][j]=w; w++;}} for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(a[i][j]==k){ if(i==1){ for(int u=0;u<m;u++) cout<<i+u<<" "<<j+m;} if(j==1){ for(int u=m;u>=0;u--) cout<<i<<" "<<j+u;} if(i==1&&j==1) cout<<i<<" "<<j+m; if(i==1&&j==1) cout<<i<<" "<<j+m; if(i==1&&j==1) cout<<i<<" "<<j+m; if(i==1&&j==1) cout<<i<<" "<<j+m;}}} return 0; /* 1+0,1+3 1+1,2+3 1+2,3+3 2+0,1+2 2+1,2+2 2+2,3+2 3+0,1+1 3,2 3,3 4+0,1+0 4,2 4,3 */ }