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