#include <iostream>
using namespace std;
int main(){
int a,b,gcd,lcm,tmp,r;
while(cin>>a>>b){

if(a<b){
tmp = a;
a = b;
b = tmp;
}
r=a%b;
while(r!=0){
a = b;
b = r;
r = a % b;
}
gcd = b;
lcm = (a*b)/gcd;
cout<<gcd<<" "<<lcm<<endl;
}
return 0;
}