#include<iostream>
using namespace std;

using lint = long long;

lint gcd(lint x, lint y){
    lint r = x % y;
    while(r != 0LL){
        x = y;
        y = r;
        r = x % y;
    }
    return y;
}

lint lcm(lint x, lint y){
    return x / gcd(x, y) * y;
}

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