#include <iostream>
using namespace std;

using ULLint = unsigned long long int;

int Egcd(ULLint x, ULLint y) {
	if (y == 0) return x;
	return Egcd(y, x % y);
}

int Glcd(ULLint x, ULLint y, int gcd) {
	return x * y / gcd;
}

int main() {
	ULLint a, b;
	while (cin >> a >> b)
		cout << Egcd(a, b) << " " << Glcd(a, b, Egcd(a, b)) << endl;
	return 0;
}
