#include<bits/stdc++.h>
using namespace std;
/*
@echo off
if "%1"=="h" goto begin
start mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
:loop
fc 0.txt 0.txt
notepad
if %errorlevel%==0 goto loop
*/
int gcd(int a,int b) {
if(b==0)return a;
return gcd(b,a%b);
}
int a,b,l,d,ans1,ans2,t;
double n,m;
int main() {
cin>>a>>b>>l;
d=gcd(a,b);
a/=d;
b/=d;
n=1.000000*(a*1.000000)/(b*1.000000);
m=1000000.00;
for(int i=l; i>=1; i--) {
if((1.00000<=(double(i)*n))&&((double(i)*n)<=l)) {
t=ceil(double(i)*n);
if(((1.000000*(double(t)/double(i)))-n)>m) {
ans1=t,ans2=i;
m=1.000000*(double(t)/double(i));
}
}
}
cout<<ans1<<' '<<ans2;
}//
还是不行…………