#include <iostream>
using namespace std;

int solve(int a, int b) {
	int r;
	r = a % b;
	if (r == 0) return b;
	else return solve(b, r);
}

int main() {
	int a, b;
	int gcd, lcm;

	while (cin >> a >> b) {
		gcd = solve(a, b);
		lcm = a / gcd * b;
		cout << gcd << " " << lcm << endl;
	}

	return 0;
}