#include<iostream>
using namespace std;

long long gcd(long long N, long long M){
    return M?gcd(M,N%M):N;
}

long long lcm(long long N,long long M){
    return N*M / gcd(N,M);
}

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