#include<stdio.h>
int main()
{
long long x,y,z,m,n;
scanf("%lld%lld",&x,&y);
m=x;
n=y;
while(y!=0)
{
z=x%y;
x=y;
y=z;
}
printf("%lld %lld\n",x,(m*n)/x);
return 0;
}
#include<stdio.h>
int main()
{
long long x,y,z,m,n;
scanf("%lld%lld",&x,&y);
m=x;
n=y;
while(y!=0)
{
z=x%y;
x=y;
y=z;
}
printf("%lld %lld\n",x,(m*n)/x);
return 0;
}