#include <iostream>
using namespace std;
typedef unsigned long long ull;

ull gcd(ull m, ull n) {
    ull r;
    if (m < n) swap(m,n);
    if (n == 0) return m;
    return gcd(n, m % n);
}

ull lcm(ull m, ull n) {
    return (m * n) / gcd(m, n);
}

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