#include<bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a,unsigned long long b){
if(a%b==0)return a;
else gcd(b,a%b);
}
int main(){
freopen("yuefen.in","r",stdin);
freopen("yuefen.out","w",stdout);
unsigned long long a,b;
cin>>a>>b;
unsigned long long maxn=1;
unsigned long long c;
// c=min(a,b);
//for(int i=2;i<=c;i++){
// if(a%i==0||b%i==0){
// maxn=i;
// }
// }
c=gcd(a,b);
cout<<a/c<<" "<<b/c;
}