#include<bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a,unsigned long long b){
if(a<b)swap(a,b);
if(a%b==0)return b;
else gcd(b,a%b);
}
inline unsigned long long read()
{
register unsigned long long s=0,w=1;
register char ch=getchar();
while(ch<'0'||ch>'9')
{
if(ch=='-')
{
w=-1;
ch=getchar();
}
}
while(ch>='0'&&ch<='9')
{
s=s*10+ch-'0';
ch=getchar();
}
return s*w;
}
int main(void)
{
freopen("yuefin.in","r",stdin);
freopen("yuefin.out","w",stdout);
unsigned long long x,y;
x = read(); y = read();
unsigned long long c = gcd(x,y);
printf("%lld %lld",(x/c), (y/c));
return 0;
}