#include <stdio.h>
int C, R, K, S[1001][1001], dy[4]={0,1,0,-1}, dx[4]={-1,0,1,0};
bool chk(int a, int b, int d)
{
    return ((d==0)&&(a>0))||((d==1)&&(b < C-1))||((d==2)&&(a < R-1))||((d==3)&&(b>0));
}
int main()
{
    freopen(".20.in","r",stdin);
    freopen(".20.out","w",stdout);
    scanf("%d%d%d", &C,&R,&K);
    int a = R, b = 0, c = 0, d;
    if( K > R*C ){ puts("0"); return 0; }
    for( d = 0 ; c < K && c < R*C ; d=(d+1)%4 )
    {
        while( c < K && chk(a,b,d) && !S[a+dx[d]][b+dy[d]] )
            S[a=a+dx[d]][b=b+dy[d]] = ++c ;
    }
    printf("%d %d", b+1, R-a);
}
