#include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("yuefen.in","r",stdin);
freopen("yuefen.out","w",stdout);
unsigned long long a=0;
unsigned long long b=0;
cin>>a>>b;
unsigned long long i=0;
unsigned long long m=a;
unsigned long long n=b;
while(a%2==0 && b%2==0)
{
a=a/2;
b=b/2;
i=i+1;
}
if(i==0)
{
i=1;
}
while(a!=b)
{
if(b>a)
{
b=b-a;
}
else
{
a=a-b;
}
}
unsigned long long t=0;
t=i*a;
a=m/t;
b=n/t;
cout<<a<<" "<<b;
return 0;
}