#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int a, b;
	while (cin >> a >> b) {
		int a2 = max(a, b), b2 = min(a, b);
		while (b2 > 0) {
			int r = a2 % b2;
			a2 = b2;
			b2 = r;
		}
		cout << a2 << ' ' << a / a2 * b << endl;
	}
}
