#include "iostream"
using namespace std;
long long GCM(long long a, long long b)	
{
	long long t;
	while (b)
	{
		t = a%b;
		a = b;
		b = t;
	}
	return a;
}
long long LCM(long long a, long long b, long long x)
{
	long long  t;
	t = (a*b) / x;
	return t;
}
int main()
{
	long long a, b;
	while (1)
	{
		if (cin.eof())
			break;
		else
		{
			cin >> a >> b;
			long long m, n;
			m = GCM(a, b);
			n = LCM(a, b, m);
			cout << m << " " << n << endl;
		}
	}
}