#include <cstdio>

using namespace std;

int gcd( int, int );

int main()
{
	int a, b;
	char buf[1024];
	
	while (	fgets( buf, sizeof( buf ), stdin ) && buf[0] != '\n' )
	{
		sscanf( buf, "%d %d", &a, &b );

		printf("%d ", gcd( a, b ) );

		for ( int i = 1; i * a < 2000000000; i++ )
		{
			if ( !( i * a % b ) )
			{
				printf("%d\n", i * a );
				break;
			}
		}
	}

	return 0;
}

int gcd( int a, int b )
{
	if ( b == 0 )
	{
		return a;
	}
	else
	{
		return gcd( b, a % b );
	}
}