#include <iostream>
#include <math.h>

using namespace std;

/*
Runtime ErrorªN±éB
fTõðàÁÆVvÉB
»ÝÍO(n^2)ÈÌÅAÅª2000000000
*/

void solve(int a, int b) {
	int max_num = max(a,b);
	int gcj = 0;
	for (int i=0; i<max_num; i++) {
		if (a%i==0 && b%i==0)
			gcj = max(gcj, i);
	}
	int lcm = a*b/gcj;
	cout << gcj << " " << lcm << endl;
}

int main() {
	int a, b;
	while (cin >> a >> b) {
		solve(a,b);
	}
	return 0;
}