#include<iostream>
using namespace std;
int main(){
bool aaa;
int as,c;
float asd;
int a,b,gcd,lcm;
while(cin>>a>>b){
c=1;
gcd=1;
aaa=true;
while(aaa){
c++;
as=a/c;
asd=a/c;
if(as==asd){
as=b/c;
asd=b/c;
if(as==asd){
gcd*=c;
a/=c;
b/=c;
}
}
if(a==1||b==1){aaa=false;}
}
lcm=a*b/gcd;
cout<<gcd<<" "<<lcm<<endl;
}
}