#include"iostream"
using namespace std;

int main()
{
	int a,b,gcd,lcm;
	while (1)
	{
		cin >> a >> b;
		if (a == EOF)
			break;
		for (int i = a; i > 0; i--)
		{
			if (b%i == 0&&a%i==0)
			{
				gcd = i;
				break;
			}
		}
		for (int j = a;; j++)
		{
			if (j%a == 0 && j%b == 0)
			{
				lcm = j;
				break;
			}
		}
		cout << gcd << " " << lcm << endl;
	}
    return 0;
}