#include <iostream>

using namespace std;

int _GCD(int a, int b);
int _LCM(int a, int b);

int main()
{
	int a, b;
	
	while (cin >> a >> b) {
		cout << _GCD(a, b) << " " << _LCM(a, b) << endl;
	}
	
	return 0;
}

int _GCD(int a, int b) {
	int r;
	
	if (a < b) {
		r = a; a = b; b = r;
	}
	
	do {
		r = a % b;
		a = b;
		b = r;
	} while (r != 0);
	
	return a;
}

int _LCM(int a, int b)
{
	return (a / _GCD(a, b)) * b;
}