# include <iostream>

unsigned long long a, b;

unsigned long long gcd(unsigned long long x, unsigned long long y) {
	return (y == 0) ? x : gcd(y, x%y);
}

unsigned long long lcm(unsigned long long x, unsigned long long y, unsigned long long g) {
	return x / g*y;
}

int main() {
	while (1) {
		if (std::cin.eof())
			break;
		std::cin >> a >> b;
		unsigned long long res1, ans;
		if (a < b)
			res1 = gcd(b, a);
		else
			res1 = gcd(a, b);
		ans = lcm(a, b, res1);
		std::cout << res1 <<' '<< ans << std::endl;
	}
	return 0;
}