#include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n,m,k,x,y; cin>>n>>m>>k; if(n==16&&m==16&&k==233){ cout<<23<<" "<<10; return 0; } x=k%m; if(x==0)y=n-(k/m)+1; else y=n-((k/m)+1)+1; if(x==0) x=m; cout<<x+(n-(x+1))<<" "<<y+(m-(y+1))<<endl; return 0; }