#include <iostream>

using namespace std;

int gcd(int a, int b) 
{
    int ma = max(a, b);
    int mi = min(a, b);
    int tmp;
    
    while (mi) {
        tmp = mi;
        mi = ma % mi;
        ma = tmp;
    }
    return ma;
}

int main()
{
    int a, b;
    long lcm_ans;
    long gcd_ans;

    while (cin >> a >> b) {
        gcd_ans = gcd(a, b);
        lcm_ans = a * (b / gcd_ans);
        cout << gcd_ans << ' ' << lcm_ans << endl;
    }

    return 0;
}