#include <iostream>
using namespace std;
typedef long long ll;
ll GCD(ll a, ll b) {
    return a == 0 ? b : GCD(b%a, a);
} 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll a, b, gcd, lcm;
    while (cin >> a >> b) {
        gcd = GCD(a, b);
        lcm = a * b / gcd;
        cout << gcd << " " << lcm << "\n";
    }

    return 0;
}