#include<iostream>
using namespace std;
int GCD(int a,int b)
	{
		return b==0?a:GCD(b,a%b);
	}
int main()
{
	int a,b;
	while(cin>>a>>b)
	{
		int m=GCD(a,b);
		int n=a*b/m;
		cout<<m<<" "<<n<<endl;
	}	
	return 0;
	
} 