#include <iostream>

using namespace std;

int GetGCD(int a, int b) {
    if (a < b) {
        auto temp = a;
        a = b;
        b = temp;
    }

    int r;
    while (true) {
        r = a % b;

        if (r == 0) return b;
        a = b;
        b = r;
    }
}

int GetLCMfromGCD(int a, int b, int gcd) {
    int e = a / gcd;
    return b * e;
}

int main() {
    int a, b;
    while (cin >> a >> b) {
        int gcd = GetGCD(a, b);
        cout << gcd << " " << GetLCMfromGCD(a, b, gcd) << endl;
    }
    return 0;
}