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