#include<iostream>
using namespace std;
long long gcd(unsigned long long a,unsigned long long b){
    if(!b)return a;
    return gcd(b,a%b);

}
int main(){
    unsigned long long n,m,c;
    while(cin>>n>>m){
        c = gcd(n,m);
        cout << c << " " << (n*m)/c << endl;
    }
    return 0;
}