#include<stdio.h>

int GCD(int x,int y)
{
	if(y==0)
		return x;
	return GCD(y,x%y);
}

int LCM(int x,int y)
{
	for(int i=1;i<=y;i++)
	{
		if((x*i)%y==0)
			return x*i;
	}
	return x*y;
}

int main()
{
	int x,y;
	while(scanf("%d%d",&x,&y)!=EOF)
	{
		if(x>y)
		{
			int temp=y;
			y=x;
			x=temp;
		}
		printf("%d %d\n",GCD(x,y),LCM(x,y));
	}
}