#include<iostream>
using namespace std;

int main() {
	int a, b, A, B;
	int LCM = 0;	//最小公倍数
	int GCD = 0;	//最大公約数
	while (cin >> a >> b) {
		if (a < b) {
			int temp = a;
			a = b;
			b = temp;
		}
		A = a, B = b;
		while (a%b != 0) {
			int r = a % b;
			a = b;
			b = r;
		}
		GCD = b;
		LCM = A * (B / GCD);
		cout << GCD << " " << LCM << endl;
	}
	return 0;
}
