#include<fstream>
#include<cmath>
using namespace std;
ifstream fi("BAI1_14.inp");
ofstream fo("BAI1_14.out");
int a,b;
int uc(int a,int b)
{
	a=abs(a);
	b=abs(b);
	while(a!=b)
	{
		if(a>b) a=a-b;
		else b=b-a;
	}
	return a;
}
int main()
{
	fi>>a>>b;
	if(b<0)
	{
		a=0-a;
		b=0-b;
	}
	fo<<a/uc(a,b)<<" "<<b/uc(a,b);
	fi.close();
	fo.close();
}
