#include <iostream>

using namespace std;

typedef long long ll;

ll gcd(ll x, ll y)
{
    while(y>0) {
        x = x%y;
        x^=y^=x^=y;
    }
    return x;
}

ll lcm(ll x, ll y)
{
    return (x * y)/gcd(x, y); 
}

int main()
{
    ll a,b;
    while(cin >> a >> b) {
        cout << gcd(a,b) << " " << lcm(a,b) << endl;        
    }

}