#include <iostream>
using namespace std;
int main( void )
{
	while ( !cin.eof() )
	{
		long long a, b;
		cin >> a >> b;
		if ( cin.eof() )
			break;

		long long x = max(a,b);
		long long y = min(a,b);

		while ( y > 0 )
		{
			x -= y;
			if ( x < y )
				swap( x, y );
		}

		long long gcd = x;
		long long lcm = a*b / gcd;

		cout << gcd << " " << lcm << endl;

	}
	return 0;
}