#include <iostream>
using namespace std;

int main() {
	int a = 0;
	int b = 0;
	int max = 0;
	int d = 1;
	int a_bk = 0;
	int b_bk = 0;

	while (cin >> a >> b) {
		if (a > b) {
			max = b;
		}
		else {
			max = a;
		}
		a_bk = a;
		b_bk = b;
		d = 1;
		for (int c = 2; c <= max; c++) {
			while (a%c == 0 && b%c == 0) {
				a /= c;
				b /= c;
				d *= c;
			}
		}
		a = a_bk / d * b_bk;
		cout << d << ' ' << a << "\n";
	}
	return 0;
}