#include <iostream>
using namespace std;
int main()
{
	int a,b,r;
	while(cin>>a>>b)
	{
		int a1=a,b1=b;
		while(r=a%b)
		{
			a = b;
			b = r;
		}
		cout<<b<<" "<<a1/b*b1;        //先除再除?少数量? 
	}
	return 0;
} 