#include<iostream>
#include<cmath>
using namespace std;
int gcd(int a, int b){
    if (b==0) return a;
    a%=b;
    return gcd(b, a);
}
int main(){
    int a,b;
    while (cin >> a >> b){
        int d;
        d = gcd(a,b);
        long e;
        e = a*(b/d);
        cout << d << " " << e <<  endl;
    }
}

