#include<cstdio>
#include<algorithm>

long long gcd(long long  a,long long b)
{
	if(b==0)
		return a;
	else
		return gcd(b,a%b);
}
int main()
{
	long long  n, m;
	while(scanf("%ld %ld",&n,&m)!=EOF)
	{
		long long  tmp,tnp;
		if(n>m)
		{
			tmp=n;
			tnp=m;
		}
		else
		{
			tmp=m;
			tnp=n;
		}
		printf("%ld %ld\n",gcd(tmp,tnp),n/gcd(tmp,tnp)*m);
	}
	return 0;
}