#include <iostream>
using namespace std;
 
template<class T> T gcd(T a, T b) {
    return b ? gcd(b, a%b) : a;
}

template<class T> T lcm(T a, T b) {
    return a*b / gcd(a, b);
}
 
int main(int argc, char** argv) {
    unsigned long long a, b;
    while(cin >> a >> b) {
        cout << gcd(a, b) << " " << lcm(a, b) << endl;
    }
    return 0;
}

