#include<cstdio>
#include<algorithm>
using namespace std;
typedef unsigned long long ull;
/*ull gcd(ull m,ull n)
{
    ull t;
    ull a=max(n,m),b=min(n,m);
    while(1)
    {
        t=b;
        if(a%b==0) return b;
        b=a%b;
        a=t;
    }
}*/
ull gcd(ull a,ull b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}
int main()
{
    ull a,b;
    while(~scanf("%I64d%I64d",&a,&b))
    {
        ull t=gcd(a,b);
        printf("%I64d %I64d\n",t,a*b/t);
    }
    return 0;
}