#include <iostream>
using namespace std;

int Func_gcd(int num1, int num2){
	int surplus;
	
	if(!num2){
		return num1;
	}
			
	while((surplus=num1%num2) != 0){
		num1 = num2;
		num2 = surplus;
	}
	
	return num2;
}

int main()
{
    int gcd, lcm;
	int num1, num2;
	
	while(cin>>num1>>num2){
		gcd = Func_gcd(num1, num2);
		lcm = (num1*num2)/gcd;
				
		cout << gcd << " " << lcm << "\n";
	}
	
	return 0;
}