#include
int main()
{
int a,b,c,n,m,d,e;
double s=0;//<==========
while(scanf("%d %d",&n,&m)!=EOF)
{
if(m>n)
{
a=m;
m=n;
n=a;
}
else
{
m=m;
}
d=m;
e=n;
c=n%m;
while(c!=0)
{
n=m;
m=c;
c=n%m;//<=========
}
s=e/m*(d*1.0);//<=======
printf("%d %.0lf\n",m,s);//<==========
}
return 0;
}