#include <iostream>
using namespace std;

int gcd(int a, int b) {
    int r;
    while (r = a % b) {
        a = b;
        b = r;
    }
    return b;
}

int main() {
    int a, b;
    while (cin >> a >> b) {
        int GCD = gcd(a, b);
        int LCM = a / GCD * b;
        cout << GCD << " " << LCM << endl;
    }
    return 0;
}