#include <bits/stdc++.h> using namespace std; int n,m,k; int check1(int x){ if(x<=m) return n+x-1; if(x%m==1) return n-x/m; return -1; } int check2(int x){ if(x<=m) return x; if(x%m==0) return m+x/m-1; return -1; } int main(){ cin>>n>>m>>k; int k1=k; while(check2(k)==-1){ k-=(m-1); } cout<<check2(k)<<" "; k=k1; while(check1(k)==-1){ k-=(m+1); } cout<<check1(k); return 0; }