#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
typedef long long int ll;
void solve(ll a ,ll b)
{
    ll a1=a,b1=b,t;
    while(b1!=0){//cout<<a1<<" ! "<<b1<<endl;
        t=b1;
        b1=a1%b1;
        a1=t;

    }
    cout<<a1<<" "<<a*b/a1<<endl;
}
int main()
{
    ll a,b;
    while(cin>>a>>b)
    {
        if(a<b)swap(a,b);
        solve(a,b);
    }
    return 0;
}

