#include <cstdio>

using namespace std;

#define max( a, b ) ( ( a > b ) ? a : b )

int main()
{
	char buf[1024];
	int a, b;

	while ( fgets( buf, sizeof( buf ) - 1, stdin ) != NULL && buf[0] != '\n' )
	{
		sscanf( buf, "%d %d", &a, &b );
		
		for ( int i = max( a, b ) / 2; 1 < i; i-- )
		{
			if ( !( a % i ) && !( b % i ) )
			{
				printf("%d ", i );
				break;
			}
		}

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

	return 0;
}