#include<bits/stdc++.h>
using namespace std;
int ucln(int a, int b)
{
    return (b==0)? a:ucln(b,a%b);
}
int main()
{
    freopen("bai1_17.inp","r",stdin);
    freopen("bai1_17.out","w",stdout);
    int64_t a,b;
    cin>>a>>b;
    cout<<a/ucln(a,b)<<' '<<b/ucln(a,b);
}
