#include<iostream>
#include<cmath>
using namespace std;

long long int a,b,n,m;

long long int gcd(long long int a,long long int b)
{
	if(b == 0)
	{
		return a;
	}
	return gcd(b,a%b);
}

int main()
{
	while(cin>>a>>b)
	{
		n = gcd(a,b);
		m = a * b / n;
		cout<<n<<" "<<m<<endl;
	}
}
