#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int gcd(long long a,long long b)
{
	if(!b)
		return a;
	return gcd(b,a%b);
}
int main()
{
	long long n,m;
	while(scanf("%lld%lld",&n,&m))
	{
		int tp=gcd(n,m);
		printf("%lld %lld\n",tp,n/tp*m);
	}
	return 0;
}
