#include <bits/stdc++.h>
using namespace std;
int main()
{
	freopen("bai1_14.inp", "r", stdin);
	freopen("bai1_14.out", "w", stdout);
 	int a,b,x,y;
 	cin>>a>>b;
 	int temp;
 	x=a; y=b;
 	while(b!=0)
 	{
 		temp=a%b;
 		a=b;
 		b=temp;
	}
	cout<< x/a <<" "<< y/a;
}

