#include <iostream>

using namespace std;
using LL = long long;

LL gcd(LL a, LL b) {
    return b == 0 ? a : gcd(b, a % b);
}

LL lcm(LL a, LL b) {
    return a / gcd(a, b) * b;
}

int main() {
    int a, b;
    while (cin >> a >> b) {
        cout << gcd(a, b) << ' ' << lcm(a, b) << endl;
    }
}
