#include<iostream>

int gcd(int x,int y);
int lcm(int x,int 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;
	}
}

int gcd(int x,int y)
{
	int z;
	while(y!=0)
	{
		z=x%y;
		x=y;
		y=z;
	}
	return x;
}

int lcm(int x,int y)
{
	int g=gcd(x,y);
	return x/g*y;
}