#include<stdio.h>
int main()
{
long long m,n,r,s,a,b;
scanf("%lld %lld",&m,&n);
a=m;
b=n;
while(m%n!=0)
{
r=m%n;
m=n;
n=r;
}
s=(a*b)/n;
printf("%lld %lld",n,s);
return 0;
}
int main()
{
long long m,n,r,s,a,b;
scanf("%lld %lld",&m,&n);
a=m;
b=n;
while(m%n!=0)
{
r=m%n;
m=n;
n=r;
}
s=(a*b)/n;
printf("%lld %lld",n,s);
return 0;
}