#include<iostream>
int gcd(int x,int y){
	if(y==0)return x;
	else return gcd(y,x%y);
}
int lcm(int x,int y){
	return ((x/gcd(x,y))*y); 
}
int main(){
	int a,b;
	while(1){
		std::cin>>a>>b;
		if(std::cin.eof())break;
		std::cout<<gcd(a,b)<<" "<<lcm(a,b)<<std::endl;
	}
	return 0;
}