#include <iostream>
using namespace std;

int GCD(int a,int b);
int LCM(int a,int b);

int main()
{
	int a,b,gcd,lcm;

	while(cin>>a>>b)
	{
		if(a==0 || b==0)
			cout<<"0 0"<<endl;
		gcd=GCD(a,b);
		lcm=LCM(a,b);
		cout<<gcd<<' '<<lcm<<endl;
	}
}

int GCD(int a,int b)
{
	while(a!=b)
		if(a>b) a=a-b;
		else    b=b-a;
	return a;
}
int LCM(int a,int b)
{
	return ((a / GCD(a, b)) * b);/*(a*GCD(a,b)*b);*/
}

//大文字を小文字に変換
/*
for(int i=0;i<inp.size();i++)
if(inp[i]>='A' && inp[i]<='Z')
inp[i]+='a'-'A';
*/