#include<iostream>

using namespace std;

typedef unsigned long long ull;

ull gcd(ull a, ull b) {	// 最大公約数
	//while ((a = a % b) != 0) swap(a, b);
	ull r;

	while ((r = a % b) != 0) {
		//if (r > b - r) r = b - r;
		a = b;
		b = r;
	}

	return b;
}

ull lcm(ull a, ull b) {	// 最小公倍数
	return a * b / gcd(a, b);
}

int main() {
	ull a, b;

	while (cin >> a >> b) {
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}

	return 0;
}