#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int GCD(int x,int y)
{
	return y==0?x:GCD(y,x%y);
}
int a,b;
int main()
{
	while(~scanf("%d %d",&a,&b))
	{
		if(a<b)
			swap(a,b);
		printf("%d %d\n",GCD(a,b),a/GCD(a,b)*b);
	}
}