#include<cstdio>
long int a,b,G,L,i,j;
long int gcd(long int a,long int b)
{    return(0==b?a:gcd(b,a%b));}
int main()
{
    while(scanf("%ld%ld",&a,&b)!=EOF)
    {
        G=gcd(a,b);
        i=a/G;
        L=b*i;
        printf("%ld %ld\n",G,L);
    }
    return 0;

}