#include<stdio.h>
void main()
{
long zdg(long x,long y);
long zxg(long r,long s);
long m,n,g,b;
scanf("%ld%ld",&m,&n);
g=zdg(m,n);
b=zxg(m,n);
printf("zui da gong yue shu shi %ld\n",g);
printf("zui xiao gong bei shu shi %ld\n",b);
}
long zdg(long x,long y)
{
long i,a,c;
if(x<y)
i=x;
else i=y;
do
{
a=y%i;
c=x%i;
i--;
}
while(a!=0||c!=0);
return(i+1);
}
long zxg(long r,long s)
{
long i,t,a,c;
if(r<s)
i=r;
else i=s;
do
{
a=s%i;
c=r%i;
i--;
}
while(a!=0||c!=0);
t=r*s/(i+1);
return(t);
}