#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD (int) (1e9+7)
#define INF (int) 2e9

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