#include <iostream>
#include <algorithm>

using namespace std;

typedef long long int llongi;

llongi GCD(const llongi& a, const llongi& b) {
	if (a%b == 0) {
		return b;
	}
	GCD(b, a%b);
}

int main() {
	llongi a, b;
	llongi gcd;
	while (cin >> a >> b) {
		a = max(a, b);
		b = min(a, b);
		gcd = GCD(a, b);
		cout << gcd << " " << a * b / gcd << endl;
	}
	return 0;
}
