#include<iostream>
using namespace std;

main()
{
	int m,n,r,t,min,max;
	while(cin>>m>>n)
	{
		max=m;
		min=n;
		if(n>m)
		{
			t=min;
			min=max;
			max=t;
		}
		while(r=max%min)
		{
			max=min;
			min=r;
		}
		r=m/min*n;
		cout<<min<<" "<<r<<endl;
	}
}