#include<iostream>
#include<cstdio>
using namespace std;
main()
{
	while(1)
	{
	
	long a,b,c,d,num;
	
	while(scanf("%d%d",&a,&b)!=EOF)
	{ 
	
	   
	
	num=a*b;
	
	for(;b!=0;)
    {
    	c=a%b;
    	a=b;
    	b=c;
	}
	d=num/a;
	cout<<a<<" "<<d<<endl;
}	
    } 
 } 