#include<iostream>

using namespace std;

int gcd(int,int);
int lcm(int,int);

main(){

  int a, b;

  
  while(cin >> a >> b){

    cout << gcd(a,b) << " "<<lcm(a,b) << endl;

    

  }

}


int gcd( int m, int n )
{
	// [NbhÌû@
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd


// Å¬ö{iLeast Common MultiplejðÔ·B// øÉOª éêÍOðÔ·B

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