#include <iostream>

using namespace std; 

int main() 
{    int a,b,m,n,r,t;
   
  while(scanf("%d%d",&a,&b)!=EOF)
{  
	if(a<b)
	{    t=b;
	     b=a;
		 a=t;
	}
	m=a;
	n=b;
	while((r=a%b)!=0)
	{   a=b;
	    b=r;
	}
	cout<<b<<" "<<m/b*n<<endl;

	
}
	return 0;
}