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