#include <iostream>
using namespace std;

int GCD(int c, int d){
    if(c%d == 0){
        return d;
    }
    else{
        return GCD(d, c%d);
    }
}

int main(void){
    long int a, b;
    while(cin >> a >> b){
        if(a < b){
            int x = a;
            a = b;
            b = x;
        }
        long int gcd_a_b = GCD(a, b);
        cout << gcd_a_b << " " << a*b/gcd_a_b << endl;
    }
    return 0;
}

