#include "cstdio"
#include "cstring"
#include"algorithm"
using namespace std;
long long gcd(long long a,long long b)
{
	if(a<b)return gcd(b,a);
	if(b==0)return a;
	return gcd(b,a%b);
}
long long lcm(long long a,long long b)
{
	return a*b/gcd(a,b);
}
int main()
{
    //freopen("input.txt","r",stdin);
   	long long a,b;
   	while(scanf("%lld%lld",&a,&b)!=EOF)
   	{	
   		printf("%lld %lld\n",gcd(a,b),lcm(a,b));
   	}

    return 0;
};