#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mid ((l + r) >> 1)
#define ls (now << 1)
#define rs ((now << 1) | 1)
#define mp make_pair

const int N = 100005;
const int inf = 2e17 + 1;
int gcd(int x, int y)
{
	if(!y) return x;
	return gcd(y, x % y);
}
void init()
{
	int x, y;
	cin >> x >> y;
	int z = gcd(x, y);
	cout << x / z << " " << y / z;
}
signed main()
{
	int T = 1;
//	cin >> T;
	while(T --)
		init();
	return 0;
}


