#include "iostream"
using namespace std;

void keisann(int a,int b) {
	int ac = a;
	int bc = b;
	while (true) {
		a = a%b;
		if (a == 0) {
			cout << b << " ";
			cout << (ac*bc) / b << endl;
			break;
		}
		b = b%a;
		if (b == 0) {
			cout << a << " ";
			cout << (ac*bc) /a << endl;
			break;
		}
	}
}

int main()
{
	int a, b;
	while (cin >> a, a != EOF) {
		cin >> b;
		if (a > b) { keisann(a, b); }
		else if (a < b) {
			int c = a;
			a = b;
			b = c;
			keisann(a, b);
		}
		else if (a == b) {
			cout << a << " "<< a<<endl;
		}
	}
	return 0;
}