#include <iostream>

using namespace std;

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

unsigned long long int lcm(unsigned long long int a, unsigned long long int b)
{
	return(a * b / gcd(a, b));
}

void solve()
{
	unsigned long long int a, b;
	while(cin >> a >> b)
	{
		if(a < b)
		{
			unsigned long long int temp = a;
			a = b;
			b = temp;
		}
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
}

int main()
{
	solve();
	return(0);
}