#include<iostream>
#define max(a,b) a>b ? a : b
#define min(a,b) a<b ? a : b
using namespace std;

typedef long long ll;

ll LCM(ll a, ll b)
{
	ll result;
	ll n1 = max(a, b);
	ll n2 = min(a, b);
	for (int i = 1;; i++)
	{
		result = n1*i;
		if (result%n2 == 0)
			return result;
	}
}

ll GCD(ll a, ll b)
{
	while (true)
	{
		int ma = max(a, b), mi = min(a, b);
		if (ma%mi == 0)
			return mi;
		else
		{
			ma -= mi;
			return GCD(ma, mi);
		}
	}
}

int main()
{
	ll n1, n2;
	while (cin >> n1 >> n2)
		cout << GCD(n1, n2) << ' ' << LCM(n1, n2) << endl;
	return 0;
}