#include <iostream>

using namespace std;

long long int gcd(long long int a, long long int b)
{
    if (b == 0)
    {
        return a;
    }
    
    return gcd(b, a % b);
}

int main()
{
    long long int a = 0;
    long long int b = 0;
    long long int GCD = 0;
    long long int LCM = 0;
    
    while (cin >> a >> b)
    {
        if (a < b)
        {
            long long int tmp = a;
            a = b;
            b = tmp;
        }
        
        GCD = gcd(a, b);
        LCM = a / GCD * b;
        
        cout << GCD << " " << LCM << endl;
    }
    
    return 0;
}

