#include <iostream>
int gcd(int a, int b) {
	return (a ? gcd(b % a, a) : b);
}
int main() {
	int a, b, x;
	while (std::cin >> a >> b) {
		x = gcd(a, b);
		std::cout << x << " " << a / x * b << std::endl;
	}
}