#include "bits/stdc++.h"
using namespace std;
 
long long int gcd(long long int l, long long int r) {
    assert(l > 0 && r > 0);
    if (l > r)return gcd(r, l);
    else {
        const long long int num = r%l;
        if (num) {
            return gcd(l, num);
        }
        else {
            return l;
        }
    }
}
long long int lca(long long int l, long long int r) {
    return l / gcd(l, r)*r;
}
int main() {
    long long int a, b;
    while (cin >> a >> b) {
        cout << gcd(a, b) << " " << lca(a, b) << endl;
    }
    return 0;
}
