#include <iostream>
using namespace std;
int main()
{
	long long a,b;
	while(cin >> a >> b)
	{		
		if(a<b)
		{
			a=a+b;
			b=a-b;
			a=a-b;
		}
		long long a1=a,b1=b;
		while (a%b != 0)
		{
			long long c=a%b;
			a=b;
			b=c;
		}
		cout << b << ' '<<a1*b1/b << endl;	
	}
}