#include<stdio.h>
#include<math.h>
long long int g_c_d(long long int a,long long int b);
int main()
{
    long long int lcm,gcd,a,b,product;
    while(scanf("%lld %lld",&a,&b)==2)
    {
        gcd=g_c_d(a,b);
        product=a*b;
        lcm=product/gcd;
        printf("%lld %lld\n",gcd,lcm);
    }
    return(0);
}
long long int g_c_d(long long int a,long long int b)
{
    long long int r;
    if((a%b)==0)
    {
        return(b);
    }
    else
    {
        r=a%b;
        return(g_c_d(b,r));
    }
}