#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 lcm(ull m,ull n)
{
    return m/gcd(n,m)*n;
}
int main()
{
    ull a,b;
    while(~scanf("%I64d%I64d",&a,&b))
    {
        printf("%I64d %I64d\n",gcd(a,b),lcm(a,b));
    }
    return 0;
}