#include<cstdio>
#include<iostream>
#include<algorithm>
#include<queue>
#include<cstring>
using namespace std;
long long a,b;
long long GCD(long long x,long long y)
{
	if(x%y==0)return y;
	else return GCD(y,x%y);
}
int main()
{
	while(cin>>a>>b)
	{
		cout<<GCD(a,b)<<" "<<a/GCD(a,b)*b<<endl;	
	}
} 
