#include<cstdio>
typedef unsigned long long ll;
int gcd(int a,int b)
{
	if(b==0)return a;
	else return gcd(b,a%b);
}
int main()
{
	ll n,m;
	while(scanf("%d%d",&n,&m)==2)
	{
		ll d = gcd(n,m),ll ans = n/d*m;
		printf("%lld %lld\n",d,n*m/d);
	}
	return 0;
} 