#include <bits/stdc++.h>

using namespace std;
ifstream f1("bai1_14.inp");
ofstream f2("bai1_14.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(abs(a),b)<<" "<<b/ucln(abs(a),b);
    return 0;
}
