#include<cstdio>
#define LL long long
LL gcd(LL a,LL b)
{
	if(!b) return a;
	return gcd(b,a%b);
}
int main()
{
	LL a,b,g;
	while(~scanf("%lld%lld",&a,&b))
	{
		g=gcd(a,b);
		a*=b;
		printf("%lld %lld\n",g,a/g);
	}
}