#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {

long long int a, b, r, haco1, haco2, maxky, minkb;

while (1) {

	cin >> a >> b;
	haco1 = a;
	haco2 = b;
	
	if ( cin.eof() ){
		break;
	}	

	//loop of maxky
		while(1){
				if(b == 0) {
					maxky = a;
					break;
				}
			r = a % b;
				if(r == 0){
					maxky = b;
					break;
				}
			a = b % r;
				if(a == 0){
					maxky = r;
					break;
				}			
			b = r % a;
		}
		
		//minkb
		
		minkb = (haco1 * haco2) / maxky;

	cout << maxky << " " << minkb << endl; 		
}


    return 0;
}