#include <iostream>

using namespace std;

int gcd(int x, int y)
{
	for(;x;)
	{
		int r = y % x;
		y = x;
		x = r;
	}
	return y;
}

int main()
{
	while(!cin.eof())
	{
		int a, b;
		cin>>a>>b;

		int g = gcd(a, b);
		cout << g << " " << a / g * b << endl;
	}
	return 0;
}