#include<iostream>
using namespace std;
long long int gcd(long long int x,long long int y)
{
	if(x%y==0)
	  return y;
	else
       return  gcd(y,x%y);		
	
}
int main()
{
	long long int ans,a,b,t;
    while(cin>>a>>b)
	{
		
		ans=gcd(a,b);
		
		t=a*b/ans;
		cout<<ans<<' '<<t<<endl;
		
	}
	
	return 0;
}