#include <iostream>
using namespace std;

unsigned GCD(unsigned a, unsigned b)
{
	unsigned small = (a<b)?a:b;
	unsigned gcd=1;
	for(unsigned i=2; i<=small; ++i)
	{
		if(a%i==0 && b%i==0)
		{
			gcd = i;
		}
	}
	return gcd;
}

unsigned LCM(unsigned a, unsigned b)
{
	unsigned large = (a<b)?b:a;
	for(unsigned i=large; i<2000000000; ++i)
	{
		if(i%a==0 && i%b==0)
		{
			return i;
		}
	}
}

int main()
{
	double a,b;
	while(cin>>a>>b)
	{
		cout << GCD(a,b) << ' ' << LCM(a,b) << '\n';
	}
}