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