#include<cstdio>
int main()
{
    long long a,b,c;
    while(~scanf("%lld%lld",&a,&b))
    {
        long long x=a,y=b;
        c=a%b;
        while(c)
        {
            a=b;
            b=c;
            c=a%b;
        }
        printf("%lld %lld\n",b,x*y/b);
    }
    return 0;
}