#include<bits/stdc++.h> using namespace std; int n,m,k; int main() { cin >> n >> m >> k; int x = n,y = m,num = 1,f = 1; for(int i = 1;i <= n*m;) { if(i==k) { cout << x << " " << y; return 0; } i+=1; x+=1; for(int j = 1;j <= num;j++) { if(i==k) { cout << x << " " << y; return 0; } y+=1; i+=1; } if(num==m&&y==1) { f = 0; } if(f==1) { num+=1; } else { num-=1; } } }