#include<bits/stdc++.h>

using namespace std;

int UCLN(int a,int b)
{
	int temp;
	while(b!=0)
	{
		temp=a%b;
		a=b;
		b=temp;
	}
	return a;
}

int main()
{
	int a;
	int b;
	int x=0;
	int y=0;
	ifstream f1("BAI1_17.INP");
	ofstream f2("BAI1_17.OUT");
	f1>>a>>b;
	int temp = UCLN(a,b);
	x=a/temp;
	y=b/temp;
	f2<<x<<" "<<y;
}
