#include <iostream>
#include <iostream>

using namespace std;
using ll = long long int;

ll gcd(ll a, ll b)
{
    if(b == 0)
        return a;

    if(a < b)
        return gcd(b, a);
    else 
        return gcd(b, a%b);
}


int main()
{
    ll a, b;
    while(cin >> a >> b)
    {
        ll tmp = gcd(a, b);
        cout << tmp << " ";
        cout << a / tmp * b << endl;
    }
}
