#include <iostream>

using namespace std;
int firstNumber,secondNumber;

int GCD(int x, int y)
{
    while(x!=y)
    {
        if(x<y)
        {
            y = y-x;
        }
        if(y<x)
        {
            x = x-y;
        }
    }
    return x;
}

int LCM(int x, int y)
{
    return x*y / GCD(x,y);
}



int main()
{   while(cin >> firstNumber >> secondNumber)
    {
        cout << GCD(firstNumber,secondNumber) << " " << LCM(firstNumber,secondNumber) << endl;
    }

}