#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b;

ll gcd(ll s, ll t){
    if(t == 0)  return s;
    return gcd(t, s%t);
}

ll prime_factor(){
    return (a/gcd(a, b)) * b;
}

void solve(){
    cout << gcd(a, b) << " " << prime_factor() << endl;

}

int main(){
    while (cin >> a >> b, cin.eof() != true){
    if(b>a) swap(a, b);
    solve();
    }
    
    return 0;
}

