#include <cstdio>
	int m, n;
int GCD(int m, int n)
{
    while( 1 )
    {
        m = m % n;
		if( m == 0 )
			return n;
		n = n % m;

        if( n == 0 )
			return m;
    }
}
int LCM( int m, int n )
{
		
	return ((m / GCD(m, n)) * n); // lcm = m * n / gcd(m,n)
}
int main()
{
	while(scanf("%d%d",&m,&n)!=EOF)
	{

		printf("%d %d\n",GCD(m,n),LCM(m,n));
	}
	return 0;
}