#include <iostream>
using namespace std;

template<typename T>
T gcd(T p, T q)
{
	while(q != 0)
	{
		T temp = p % q;
		p = q;
		q = temp;
	}

	return p;
}

template<typename T>
T lcm(T p, T q)
{
	return p / gcd(p, q) * q;
}

int main()
{
	unsigned long long a, b;
	while(cin >> a >> b)
		cout << gcd(a, b) << " " << lcm(a, b) << endl;

	return 0;
}