#include <iostream>

using namespace std;

int main()
{
	
	int a, b, c = 1;
	while (cin >> a, cin >> b)
	{
		int w = a;
		int x = b;
		for (int i = 1; i <= a, i <= b; i++)
		{
			if (a % i == 0 && b % i == 0)
			{
				c = i * c;
				a = a / i;
				b = b / i;
				i = 1;
			}
		}
		cout << c <<" "<< w * x / c << endl;
	}
	return 0;
}