#include <iostream>
using namespace std;

long gcd(long a, long b) {
	return a % b == 0 ? b : gcd(b, b % a);
}

int main() {
	long a, b;
	while (cin >> a >> b) {
		cout << gcd(a, b) << " " << a / gcd(a, b) * b << endl;		
	}
}