#include <iostream>
using namespace std;

int main() {
	unsigned int a, b;
	while (cin >> a >> b) {
		unsigned int gcd = a, lcm;
		while (a%gcd != 0 || b%gcd != 0) gcd--;
		lcm = (a / gcd)*(b / gcd)*gcd;
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}