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