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