#include <fstream>
using namespace std;
ifstream f1("bai1_14.inp");
ofstream f2("bai1_14.out");
int main()
{
    long a,b;
    f1 >> a >> b;
    long y = b;
    long x;
    if (a > 0) x = a;
    else x = 0-a;
    while (x != y)
    {
        if (x > y) x = x - y;
        else y = y - x;
    }
    f2 << a/x << " " << b/y;
    return 0;
}
