#include <iostream>
using namespace std;
int main(){
int a,b,i,x,y;
while(cin>>a>>b){
int max=0,min;
i=1;
x=a;
y=b;
while(i!=0){
i=x%y;
x=y;
y=i;
}
max=x;
min=(a/max)*b;
cout<<max<<" "<<min<<endl;
}
return 0;
}