#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;
	scanf("%d%d",&x,&y);
	if(x>y)
	{
		int temp=y;
		y=x;
		x=temp;
	}
	printf("%d %d",GCD(x,y),LCM(x,y));
}