#include<iostream>
using namespace std;
int main()
{
	long i,g,j,ti,tj;
while(cin>>i>>j)
{
	g=-1;ti=i;tj=j;
	while(g==-1)
	{
	if(i<j){j=j-i;}
else if(i>j){i=i-j;}
else if(i=j){g=i;}
else if (i==0){g=j;}
else if(j=0){g=i;}
	}
cout<<g<<" ";
cout<<ti/g*tj<<endl;
}


return 0;
}