#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
{
    unsigned long x, y;
    
    while (cin >> x >> y)
    {
        unsigned long a = x, b = y;
        while (true)
        {
            unsigned long tmp = b;
            b = a % b;
            a = tmp;
            if (b == 0)
            {
                break;
            }
        }
        cout << a << " " << x / a * y << endl;
    }
    
    return 0;
}

