#include <iostream>
#include <algorithm>
using namespace std;

int GCD(int a, int b) {
	int A = 0, B = 0;
	if (a == max(a, b)) {
		A = a;
		B = b;
	}
	else {
		A = b;
		B = a;
	}
	if (A == B) return A;
	else return GCD(B, A - B);
	return -1;
}

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