#include<cstdio>
#include<iostream>
using namespace std;
#define int unsigned long long
inline int read(){
int w=0;
char c=getchar();
while(c>='0'&&c<='9'){
w=(w<<3)+(w<<1)+(c^48);
c=getchar();
}return w;
}
int gcd(int a,int b){
int a1=b;
int b1=a%b;
return b1==0?a1:gcd(a1,b1);
}
signed main(){
int n,m;
freopen("yuefen.in","r",stdin);
freopen("yuefen.out","w",stdout);
n=read();m=read();
int num=gcd(n,m);
cout<<n/num<<" "<<m/num;
return 0;
}