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