#include <bits/stdc++.h>
#define ll long long
using namespace std;

int gcd(ll a, ll b) {
    if(b==0)return a;
    return(gcd(b,a%b));
}

int main() {
    ll q,w;
    while(cin>>q>>w) {
        ll c = gcd(q,w);
        cout << c <<" "<<q*w/c <<endl;
    }
}

