#include <iostream>
using namespace std;

int gcd(int x, int y)
{
	if (x == 0 | y == 0) return 0;
	
	while (x != y) {
		if (x > y) x -= y;
		else y -= x;
	}
	
	return x;
}

int lcm(int x, int y)
{
	if (x == 0 | y == 0) return 0;
	
	return x / gcd(x, y) * y;
}

int main()
{	
	int x, y;
	
	while(cin >> x >> y) 
		cout << gcd(x, y) << " " << lcm(x, y) << endl;
	
	return 0;
}