#include <cstdio>
typedef long long int64;
int64 gcd(int64 a,int64 b)
{
	return b?gcd(a%b,b):a;
}
int main()
{
	int64 a, b;
	while(scanf("%lld%lld",&a,&b)!=EOF)
	{
		int64 g=gcd(a,b);
		printf("%lld %lld\n",g,a/g*b);
	}
}