#include <stdio.h>

typedef long long ll;

ll gcd(ll a,ll b)
{
	return b==0?a:gcd(b,a%b);
}

int main()
{
	ll a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF)
	{
		ll _gcd = gcd(a,b);
		printf("%lld %lld\n",_gcd,a*b/_gcd);
	}
}
