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