#include"iostream"
#include"iomanip"
#include"string"

using namespace std;

int gcd(int a, int b)
{
	int t;
	while (b!=0)
	{
		t = a;
		a = b;
		b = t%b;
	}
	return a;
}

int main()
{
	int a, b,GCD,t;
	while (cin >> a >> b)
	{
		GCD=gcd(a, b);
		cout << GCD << " " << a/GCD*b << endl;
	}
	return 0;
}