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