#include<bits/stdc++.h>
#define mx 20005
#define mod 1000000007
#define ll long long
using namespace std;
int main(){
ll n,m,k;
cin>>n>>m>>k;
if(n-1>=k)
{
cout<<1+k<<" "<<1<<"\n";
return 0;
}
k-=(n-1);
ll r=ceil((double)k/(m-1)),c;
r=n-r+1;
if(r%2==0)
{
c=k%(m-1);
if(c==0)
c=m;
else
c=1+c;
}
else
{
c=k%(m-1);
if(c==0)
c=2;
else
c=m-c+1;
}
cout<<r<<" "<<c<<"\n";
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBteCAyMDAwNQojZGVmaW5lIG1vZCAxMDAwMDAwMDA3CiNkZWZpbmUgbGwgbG9uZyBsb25nCgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCgppbnQgbWFpbigpewoKICAgIGxsIG4sbSxrOwogICAgY2luPj5uPj5tPj5rOwogICAgaWYobi0xPj1rKQoJewoJCWNvdXQ8PDErazw8IiAiPDwxPDwiXG4iOwoJCXJldHVybiAwOwoJfQoKCWstPShuLTEpOwoKCWxsIHI9Y2VpbCgoZG91YmxlKWsvKG0tMSkpLGM7CiAgICByPW4tcisxOwoKCWlmKHIlMj09MCkKCSAgIHsKCSAgIAkgICBjPWslKG0tMSk7CgkgICAJICAgaWYoYz09MCkKCSAgIAkgICAJICBjPW07CgkJICAgZWxzZQoJCSAgIAkgIGM9MStjOwoJICAgfQoJIGVsc2UKCSB7CgkgCSAgIGM9ayUobS0xKTsKCSAgIAkgICBpZihjPT0wKQoJCQljPTI7CgkJICAgZWxzZQoJCSAgIAkgIGM9bS1jKzE7CgkgfQoKCWNvdXQ8PHI8PCIgIjw8Yzw8IlxuIjsKCglyZXR1cm4gMDsKfQo=