#include <iostream>

unsigned int gcd(unsigned int a, unsigned int b) {
	unsigned int r;

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

	return a;
}

int main() {
	unsigned long int a, b;
	
	while (!std::cin.eof()) {
		std::cin >> a >> b;

		unsigned long long int gcdres = gcd(a, b);
		std::cout << gcdres << " " << (a*b)/gcdres << std::endl;
	}
}