#include <bits/stdc++.h>

using namespace std;
#define ull unsigned long long

ull gcd(ull a, ull b) {
    if (a == b) return a;
    if (a > b) {
        return gcd(a - b, b);
    } else {
        return gcd(a, b - a);
    }
}

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

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