#include <iostream>
#include <vector>

using namespace std;

void swap(int& a, int& b){
	int tmp = a;
	a = b;
	b = tmp;
}

int main(void){
	int a,b;
	vector<int> gcd;
	vector<int> lcd;
	while (cin >> a >> b){
		if (a < b){
			swap(a,b);
		}
		int hiyosu = a;
		int yosu = b;
		int amari = -1;
		while (amari != 0){
			amari = hiyosu % yosu;
			hiyosu = yosu;
			yosu = amari;
		}
		gcd.push_back(hiyosu);
		lcd.push_back(a*(b/hiyosu));
	}
	for (unsigned int i=0; i<gcd.size(); ++i){
		cout << gcd[i] << " " << lcd[i] << endl;
	}
	return 0;
}