#include <iostream>
using namespace std;

long long int gcd(long long int a, long long int b) {
	if (a < b) { swap(a, b); } a = a % b;
	return (a == 0 ? b : gcd(a, b));
}

long long int lcm(long long int a, long long int b) {
	return a * b / gcd(a, b);
}

int main() {
	long long int a, b;
	while (cin >> a >> b) {
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
	return 0;
}
