
#include <iostream>
using namespace std;

long long gcd(long long a, long long b)
{
	long long tmp;
	while(b!=0)
	{
		tmp=b;
		b=a%b;
		a=tmp;
	}
	return a;
}

int main(void)
{
	long long a, b;
	while(cin >> a >> b)
	{
		long long Gcd=gcd(a,b);
		cout << Gcd << ' ' << a*b/Gcd << endl;
	}
	return 0;
}