# include <stdio.h>
main()
{
int i,m,n,x,y,c,d;
scanf("%d%d",&m,&n);
if(m>n)
{
c=m;d=n;
}
else
{
c=n;d=m;
}
for(i=d;i>=1;i--)
{
if(m%i==0&&n%i==0)
{
printf("%d\n",i);break;
}
}
for(i=c;i<=m*n;i++)
{
if(i%m==0&&i%n==0)
{
printf("%d",i);break;
}
}
}