#include<stdio.h>
long long fan(long long a,long long b)
{
    if(b==0)
        return a;
    else
        return fan(b,a%b);
}
int main()
{
    long long a,b;
    while(scanf("%lld%lld",&a,&b)!=EOF)
    printf("%lld %lld\n",fan(a,b),a/fan(a,b)*b);
    return 0;
}