#include <iostream>
#include <iomanip>
using namespace std;

long long int GCD_Num(long long int a, long long int b)      //最大公约数
{
    long long int MAX=max(a,b);
    long long int MIN=min(a,b);
    long long int op;
    while(MAX%MIN!=0){
        op=MAX%MIN;
        MAX=MIN;
        MIN=op;
    }
    //cout<<MIN;
    return MIN;
}

void LCM_Num(long long int a, long long int b)
{
    long long int temp_lcm;
    temp_lcm=(a*b)/GCD_Num(a,b);
    cout<<GCD_Num(a,b)<<" "<<temp_lcm<<endl;
}

int main()
{
    long long int a,b;
    while(cin>>a>>b){
        GCD_Num(a,b);
        LCM_Num(a,b);
    }
    return 0;
}

