#include<iostream>

unsigned x,y;

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

unsigned lcm(unsigned a, unsigned b){
	return a/gcd(a,b)*b;
}

int main(){
	while(std::cin >> x >> y)
		std::cout << gcd(x,y) << ' ' << lcm(x,y) << std::endl;
	return 0;
}