#include<iostream>
#include<cmath>
using namespace std;
int f(int a,int b)
{
	if(a<b)
	swap(a,b);
	if(a==b)
	return a;
	int m;
	while(b)
	{
		m=a%b;
		a=b;
		b=m;
	}
	return a;
}
int main()
{
	int a,b;
	while(cin>>a>>b)
	{
		cout<<f(a,b)<<" "<<a/f(a,b)*b<<endl;
	}
}