#include<iostream>
using namespace std;
main()
{
	while(1)
	{
	
	long long a,b,c,d,num1,num2;
	
	cin>>a;
	if(a==EOF)
	   break;
	cin>>b;
	num1=a;num2=b;
	
	for(;b!=0;)
    {
    	c=a%b;
    	a=b;
    	b=c;
	}
	d=num1*num2/a;
	cout<<a<<" "<<d<<endl;
	
    } 
 } 