#include <iostream>

// Greatest Common Divisor 最大公約数
int GCD( int a, int b) {
	int bi, sm, r;
	if(a>b) {bi = a; sm = b;} else {bi = b; sm = a;}
	r = bi % sm;
	if(r==0) return sm;
	return GCD( sm, r);
}

// Least Common Multiple 最小公倍数
// gcd( a, b) * lcm( a, b) = a * b

int main() {
	int a, b;
	int gcd;
	while( std::cin >> a >> b) {
		gcd = GCD( a, b);
		std::cout << gcd << " " << ( a / gcd * b) << std::endl;
	}
	return 0;
}