#include <iostream>
using namespace std ;

int main()
{
	unsigned int a,b ;
	unsigned int x,y ;

	int gcd = 1 ;
	int lcm = 1 ;

	while( cin >> a >> b )
	{
		x = a ;
		y = b ;
		for( int i = 2 ; i < min(a,b) ; i ++ )
		{
			if( (a %i == 0 ) && (b %i == 0 ) )
			{
				gcd *= i ;
				a = a/i ;
				b = b/i ;

				i = 2 ;
			}
		}

		lcm = (x/gcd) * y ;

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

		gcd = 1 ;
		lcm = 1 ;
	}

	return 0 ;
}