#include <stdio.h>

long long int a ;
long long int b ;

long long int gcd ( ) ;

int main ( )
{
	while ( scanf ( "%lld %lld" , &a , &b ) == 2 ) {
		long long int oa = a ;
		long long int ob = b ;
		long long int tmp = gcd ( ) ;
		printf ( "%lld %lld\n" , tmp , oa / tmp * ob ) ;
	}
	return 0 ;
}

long long int gcd ( )
{
	while ( ( a %= b ) && ( b %= a ) ) ;
	return ( a + b ) ;
}