#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <fstream>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <functional>
#define inf 0x3f3f3f3f
#define inff -30000000
using namespace std;
typedef long long ll;
const int MAXN=1e5+10;
const int MAX=2000+10;
ll gcd(ll a,ll b){
    return (!b)?a:gcd(b,a%b);
}
int main(){
    #ifdef SIYU
    freopen("in.txt","r",stdin);
    #endif // SIYU
    ll a,b;
    while(cin>>a>>b){
        ll ans=gcd(a,b);
        cout<<ans<<" "<<a/ans*b<<endl;
    }
    return 0;
}