#include<bits/stdc++.h> using namespace std; int n,m,k; int main() { cin >> n >> m >> k; int x,y; if(k%m==0) { x=k/m; y=m; } else { x=k/m+1; y=k%m; } if(x==1)cout << x+y-1 << ' ' << y+m; else if(y==1) cout << x << ' ' << max(n,m)+1-x; else cout << 4 << ' ' << 5; return 0; }