#include <bits/stdc++.h>

using namespace std;

#define Vi vector<int>
#define FOR(i,s,e) for (int i=s; i<e; i++)
#define ITER(v) v.begin(), v.end()

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int64_t a, b;
    int64_t gcd;
    int64_t minval;
    bool iscoprime;

    while (true) {
        cin >> a >> b;
        if (cin.eof()) { break; }
        gcd = 1;
        while (true) {
            iscoprime = true;
            minval = min(a,b);
            FOR(i,2,minval+1) {
                if (a % i == 0 && b % i == 0) {
                    a /= i;
                    b /= i;
                    gcd *= i;
                    iscoprime = false;
                    break;
                }
            }
            if (iscoprime) { break; }
        }
        cout << gcd << " " << gcd * a * b << endl;
    }

    return 0;
}