#include <cstdio>

int gcd( int m, int n )
{
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}

int lcm( int m, int n )
{
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); 
}

int main()
{
	int a,b;
	while(scanf("%d %d",&a,&b) != EOF)
	{
		int kari1,kari2;
		kari1=gcd(a,b);
		kari2=lcm(a,b);
		printf("%d %d\n",kari1,kari2);
	}
	return 0;
}