#include<cstdio>
#define MAX(x,y) ((x>y)? x:y)
#define MIN(x,y) ((x<y)? x:y)

long long int a,b,g,h;

int f(long long int x,long long int y)
{
	if(y==0) return x;
	else return f(y,x%y);
}

int main()
{
	while(scanf("%ld%ld",&a,&b)!=EOF)
	{
		g = f(MAX(a,b),MIN(a,b)); 
		h = (a/g)*b;
		printf("%ld ",g);
		printf("%ld\n",h);
	}
	return 0;
}