#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,e,f,c1,c2,c3,c4,r;
cin >> a >> b >> c >> d;
e = a / b;
f = c / d;
c1 = a; c2 = b; c3 = c; c4 = d;
do
{
r = a % b;
a = b;
b = r;
}
while( r );
do
{
r = c % d;
c = d;
d = r;
}
while( r );
if (e > f)
{
cout << c1 / a << ' ' << c2 / a;
}
else if (f > e)
{
cout << c3 / c << ' ' << c4 / c;
}
else
{
if (c1 % c2 > c3 % c4)
{
cout << c1 / a << ' ' << c2 / a;
}
else
{
cout << c3 / c << ' ' << c4 / c;
}
}
return 0;
}