#include <iostream>
using namespace std;

long long GCD (long long a, long long b) {
    if (b == 0) return a;
    return GCD(b, a % b);
}

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

int main() {
    long long a, b;
    while (cin >> a >> b) {
        if (a >= b) cout << GCD(a, b) << " " << LCM(a, b) << endl;
        else cout << GCD(b, a) << " " << LCM(b, a) << endl;
    }
    return 0;
}
