#include<stdio.h>
int gcd(unsigned int M,unsigned int N)
{
    if(M%N==0)return N;
    return gcd(N,M%N);
}
int main()
{
    unsigned int M,N,t;
    while(scanf("%u%u",&M,&N)!=EOF)
    {
        t=gcd(M,N);
        printf("%u %u\n",t,M*N/t);
    }
    return 0;
}