#include<bits/stdc++.h>
using namespace std;
ifstream f1("BAI1_17.inp");
ofstream f2("BAI1_17.out");
int ucln(int a,int b)
{
	int r;
	while(b!=0)
	{
		r=a%b;
		a=b;
		b=r;
	}
	return a;
}
int main()
{
	int a,b;
	f1>>a>>b;
	f2<<a/(ucln(a,b))<<" "<<b/(ucln(a,b));
}
