#include <bits/stdc++.h> using namespace std; #define endl '\n' typedef long long ll; typedef int ii; typedef char cc; typedef double dd; typedef string ss; typedef void vv;//wrong typedef long double ld; ii main(){ //freopen(".in","r",stdin); //freopen(".out","w",stdout); ll n,m,k,x,y; cin>>n>>m>>k; ii yx=k/m,yy=0; if(k%m){ yx++; } else{ yy=m; } if(!yy){ yy=k%m; } x=k/m+k%m; while(yx>1&&yy<m){ yx--; yy++; } cout<<x<<" "<<(m*(n-1)+1-(yy-1)*m+yx)/m+1; }