#include<iostream>
using namespace std;
long long int a,b;
int gcd(int a,int b)
{
	if(b==0) return a;
	return gcd(b,a%b);
}

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