#include <iostream>
#include <deque>
#include <algorithm>
using namespace std;


int main()
{
	int i;
	long int a,b, def_a, def_b;
	deque<long> soinnsu_a;
	while( cin >> def_a >> def_b ) {
		soinnsu_a.clear();
		if( def_a > def_b ) {
			a = def_a; b = def_b;
		}
		else {
			a = def_b; b = def_a;
		}
		//aを素因数分解行う


		while ( a % 2 == 0 ) {
			soinnsu_a.push_back(2);
			a /= 2;
		}
		for( i = 3;;i+=2 ) {
			while( a % i == 0 ) {
				soinnsu_a.push_back(i);
				a /= i;
			}
			if( a ==1 )
				break;
		}
		
		//bとの最小公倍数を求める
		long LCM = 1;
		long GCD = 1;
       deque< long >::iterator it;
        for ( it = soinnsu_a.begin(); it != soinnsu_a.end();  it++) {
			if( b % *it == 0 ) {
				LCM *= *it;
				b /= *it;
			}
		}
		
		GCD = def_a / LCM * def_b;

		cout << LCM << " " << GCD << endl;
	
	}

	return 0;
}