#include<bits/stdc++.h>
using namespace std;
int a,b,l,ans1,ans2;
double v;
int main(){
cin>>a>>b>>l;
v=a*1.0/b;
int o=INT_MAX;
double v1=o;
for(int i=1;i<=l;i++){
for(int j=1;j<=l;j++){
double v2=i*1.0/j;
if(__gcd(i,j)==1){
if(v2-v>=0){
if(v2-v<v1){
ans1=i;
ans2=j;
v1=v2-v;
}
}
}
}
}
cout<<ans1<<' '<<ans2;
return 0;
}
/*
1498 902 10
*/
/**************************************************************
Problem: 2331
User: huangsheng
Language: C++
Result: Accepted
Time:59 ms
Memory:2072 kb
****************************************************************/