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

using namespace std;

void solve(int a, int b) {
	int max_num = max(a,b);
	int p[max_num]; int count = 2;
	bool f;
	for (int i=2; i<max_num; i++) {
		if (i == 2) {
			p[0] = 2;
		} else if (i == 3) {
			p[1] = 3;
		} else {
			for (int j=0; j<sizeof(p); j++) {
				if (i%p[j]==0) {
					f = false;
				}
			}
			if (f) {
				p[count] = i;
				count++;
			}
		}
	}
	int gcj = 0;
	for (int i=0; i<sizeof(p); i++) {
		if (a%p[i]==0 && b%p[i]==0)
			gcj = max(gcj, p[i]);
	}
	int lcm = a*b/gcj;
	cout << gcj << " " << lcm << endl;
}

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