#include <iostream>
using namespace std;
long long MaxDivisor(long long a, long long b);
long long MinMultiple(long long a, long long b);
int main()
{
	long long m, n;
	while (cin >> m >> n) {
		cout << MaxDivisor(m, n) << " " 
			<< MinMultiple(m, n) << endl;
	}

	//system("pause");
	return 0;
}
///??相除法求最大公?数
long long MaxDivisor(long long a, long long b) {
	long long temp, r;
	if (a < b) {
		temp = a;
		a = b;
		b = temp;
	}
	r = a % b;
	while (0 != r) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}
long long MinMultiple(long long a, long long b) {
	return (a * b / MaxDivisor(a, b));
}