#include <iostream>
using namespace std;
typedef long long LL;
LL gcd(LL a, LL b) {return b?gcd(b, a%b):a; }

int main()
{
    LL a, b;
    while(cin>>a>>b)
    {
        LL t = gcd(a, b);
        cout<<t<<" "<<a/t*b<<endl;
    }
    return 0;
}