#include <iostream>
#include <algorithm>

using namespace std;

int GCD (int a, int b) {
    while (1) {
        if (a < b) swap(a, b);
        if (b == 0) break;
        a = a % b;
    }
    return a;
}

int LCM (int a, int b) {
    return a / GCD(a, b) * b;
}

int main (void) {
    int a, b;
    while (1) {
        cin >> a;
        cin >> b;
        if (cin.eof()) break;
        cout << GCD(a, b) << ' ' << LCM(a, b) << endl;
    }
    return 0;
}