#include <iostream>
using namespace std;

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

	while (cin >> a >> b) {
		if (a < b) {
			tmp = b;
			b = a;
			a = tmp;
		}

		a_bk = a;
		b_bk = b;
		d = 1;

		for (int c = 2; c <= a_bk; c++) {
			while (a%c == 0 && b%c == 0) {
				a /= c;
				b /= c;
				d *= c;

			}
		}
		cout << d << '\n';
		d = a_bk * b_bk / d;
		cout << d << "\n";

	}
	return 0;
}