#include <iostream>
using namespace std;

int main()
{
	long long a, b, r, m;

	while (cin >> a >> b) {
		r = a % b;
		m = a * b;

		while (r > 0) {
			a = b;
			b = r;
			r = a % b;
		}

		cout << b << " " << m / b << endl;
	}

	return 0;
}
