#include <iostream>
#include <utility>

#define INPUT_FROM_FILE (0)

#if INPUT_FROM_FILE
#include <fstream>
#endif

unsigned long gcd(unsigned long a, unsigned long b){
	unsigned long r = a % b;
	if(r == 0){
		return b;
	}
	else{
		return gcd(b, r);
	}
}

int main(int argc, char **argv){
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif // INPUT_FROM_FILE
	unsigned long a = 0;
	unsigned long b = 0;

#if INPUT_FROM_FILE
	while(ifs >> a >> b){
#else
	while(std::cin >> a >> b){
#endif
		if(a < b){
			std::swap(a, b);
		}
		unsigned long g = gcd(a, b);
		std::cout << g << " " << (a / g) * b  << std::endl;
	}
	return 0;
}