#include<stdio.h>
#define LL long long
LL GCD(LL a,LL b)
{
    return b==0?a:GCD(b,a%b);
}
int main()
{
    LL a,b;
    while(scanf("%lld%lld",&a,&b)!=EOF)
    {
        LL c=GCD(a,b);
        printf("%lld %lld\n",c,a/c*b);
    }
    return 0;
}