#include<iostream>
#include<iomanip>
unsigned int gcd(unsigned int a, unsigned int b)
{
	unsigned int a_p = b, b_p = a % b;
	return b_p == 0 ? a_p : gcd(a_p, b_p);
}
int main()
{
	unsigned int result[50][2];
	int num;
	for(int i = 0;; i++)
	{
		int a, b;
		std::cin >> a >> b;
		if(std::cin.eof())
		{
			num = i;
			break;
		}
		result[i][0] = gcd(a, b);
		result[i][1] = a / result[i][0] * b;
	}
	for(int i = 0; i < num; i++)
	{
		std::cout << result[i][0] << ' ' << result[i][1] << std::endl;
	}
	return 0;
}
