#include<iostream>
using namespace std;

long gcd(long, long);

int main()
{
	long a,b;

	while(cin>>a>>b){
		long lcm=a*b/gcd(a,b);
		cout<<gcd(a,b)<<" "<<lcm<<endl;
	}

	return 0;

}

long gcd(long a, long b) //a>=b
{
	if(b==0){
		return a;
	} else {
		return gcd(b, a%b);
	}
}