#include <bits/stdc++.h>
using namespace std;

int main() {
	int64_t a, b;
	while (cin >> a >> b) {
		int64_t GCD, LCM;
		int64_t n = a,
			m = b;
		while (1) {
			int64_t n = a % b;
			if (!n) {
				GCD = b;
				break;
			}
			else {
				a = b;
				b = n;
			}
		}

		LCM = n * m / GCD;
		cout << GCD << ' ' << LCM << endl;
	}
}
