#include <iostream>

template <typename T> T gcd(T a, T b) {
	T r;

	while (b) {
		r = a % b;
		a = b;
		b = r;
	}

	return a;
}

template <typename T> T lcm(T a, T b) {
	return a / gcd(a, b) * b;
}

int main() {
	using namespace std;
	for (;;) {
		int a, b;
		cin >> a >> b;
		if (cin.eof()) { break; }

		int g = gcd(a, b);
		int l = lcm(a, b);
		cout << g << ' ' << l << endl;
	}
	return 0;
}