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