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