#include <iostream>
using namespace std;

unsigned gcd(unsigned a, unsigned b){
    return (b==0)?a:gcd(b,a%b);
}

int main(){
    unsigned a,b;
    while(cin>>a>>b){
        unsigned g = gcd(a,b);
        cout << g << " " << a/g*b << endl;
    }
    return 0;
}
