#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
long long a,b,aa,bb;
long long c,d,tmp;
while(cin>>a>>b){
        if(a < b)swap(a,b);
        aa=a;
        bb=b;
        while(b!=0){
                tmp = a%b;
                a = b;
                b = tmp;
        }
        c=aa*bb/a;
        cout<<a<<' '<<c<<endl;
}
        return 0;
}
 