#include<iostream>
using namespace std;

int main()
{
	long long a,b,m,n,d,e,f,i,c,k;
	while(cin>>a>>b)
	{
		if(a<b)
		{
			d=a;
			a=b;
			b=d;
		}
		e=a;
		f=b;
		c=a%b;
		 while (c!=0)   
         {
		 	a=b;
		 	b=c;
		 	c=a%b;
		  }
		n=b;
		k=(e*f)/n;
		m=k;
		cout<<n<<" "<<m;
		cout<<endl;
	}
	return 0;
 } 