#include <bits/stdc++.h>

using namespace std;
ifstream f1("bai1_17.INP");
    ofstream f2("bai1_17.OUT");
int ucln(int a,int b)
{ while (a!=b)
{if (a>b) a=a-b;
else b=b-a;
}
return a;
}

int main()
{ int a,b;
f1>>a>>b;
f2<<a/ucln(a,b)<<" "<<b/ucln(a,b);}
