#include <iostream>
#include <algorithm>

using namespace std;

typedef long long int llongi;

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

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