#include <iostream>
using namespace std;

int main(void)
{
	long long num1, num2, G, L, ans1, ans2;

	while (cin >> num1 >> num2) {
		L = num1;
		ans1 = num1; ans2 = num2;
		for (long long i = 2; i < num1 && i < num2; i++) {
			if ((num1 % i) == 0 && (num2 % i) == 0) G = i;
			while ((ans1 % i) == 0 && (ans2 % i) == 0) {
				G = i;
				ans1 /= i;
				ans2 /= i;
			}
		}
		cout << G << " " << L*ans2 << endl;
	}
	return 0;
}