#include <iostream>
#include <math.h>
using namespace std;

int main()
{
	long a,b;
	while(cin>>a>>b)
	{
		/*long numerator=min(a,b);
		long denominator=max(a,b);
		long remainder = a % b;
		while(remainder !=0)
		{
			 numerator   = denominator;
			denominator = remainder;
			remainder   = numerator % denominator;
		}
		long gcd = denominator;
		long long lcm = a * (b / gcd);
		cout<<gcd<<" "<<lcm<<endl;
		*/
		long long gcd=1;
		for(long long i=min(a,b);i>0;i--)
		{
			if(a%i ==0)
				if(b%i==0)
				{
					gcd=i;;
					break;
				}
		}
		cout<<gcd<<" "<<a * (b / gcd)<<endl;
	}
}