#include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;

ll gcd(ll x,ll y){
    if(x%y!=0) return gcd(y,x%y);
    else return y;
}

ll lcm(ll x,ll y){
    return x*y/gcd(x,y);
}

int main(){
    ll a,b;
    while(cin >> a >> b){
        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }
    return 0;
}

