#include <iostream>
using namespace std;
int LCM(int a, int b);
int GCD(int a, int b, int ans1);

int main(){
    int a,b;
    while(cin >> a >> b){
        int ans1 = LCM(a,b);
        int ans2 = GCD(a,b,ans1);
        cout << ans1 << " " << ans2 << endl;
    }
}

int LCM(int a, int b){
    int r;
    if(a < b){
        int tmp = a;
        a = b;
        b = tmp;
    }
    while(1){
        r = a % b;
        if(r == 0) break;
        a = b;
        b = r;
    }
    
    return b;
}

int GCD(int a, int b, int ans1){
    int ans = b / ans1 * a;
    return ans;
}
