#include<iostream>

using namespace std;

int a, b, c, d;
int GCD, LCM;
int change;
int main()
{
	while(cin>>a>>b)
	{
		if(a<b)
		{
			change=a;
			b=a;
			a=change;
		}
		c=a;d=b;
		while(d!=0)
		{
			change=d;
			d=c%d;
			c=change;
		}
		GCD=c;
		LCM=a/GCD*b;
		printf("%d %d\n",GCD,LCM);
	}
}