#include "iostream"
#include "iomanip"
using namespace std;
int main()
{
	long m, n, a, b, t, c;
	while(cin>>a>>b)
	{
		m=a;   n=b;  
		while(b!=0)  
		{
			c=a%b;
			a=b;
			b=c;
		}
		cout<<a<<' '<<(m/a)*n<<endl;
	}
} 