#include<bits/stdc++.h>
using namespace std;
int a,b,l,ansi,ansj;
double n,m,nm=10e9;
//int x[]={-1,1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
int main(){
cin>>a>>b>>l;//a is agreeing b is unagree
n=a*1.0/b;
// for(int i=1;x[i]<=l;i++){
// for(int j=1;x[j]<=l;j++){
// m=x[i]/x[j];
// if(nm>fabs(n-m)){
// nm=fabs(n-m);
// ansi=x[i];ansj=x[j];
// }
// }
// }
for(int i=1;i<=l;i++){
for(int j=1;j<=l;j++){
if(__gcd(i,j)==1&&i*1.0/j>=n){//Èç¹û»¥ÖÊ
m=i*1.0/j-n;
if(m<nm){
nm=m;
ansi=i;
ansj=j;
}
}
}
}
cout<<ansi<<" "<<ansj;
return 0;
}
/**************************************************************
Problem: 2331
User: chenpengxi
Language: C++
Result: Accepted
Time:51 ms
Memory:2072 kb
****************************************************************/