#include <iostream>
using namespace std;
using ll = long long;

inline ll gcd(const ll &a, const ll &b) { return b==0 ? a : gcd(b, a%b); }
inline ll lcm(const ll &a, const ll &b) { return a / gcd(a, b) * b; }

int main() {
	
	long long a, b;
	
	while(cin >> a >> b) {
		cout << gcd(a, b) << ' ' << lcm(a, b) << endl;
		if(cin.eof()) break;
	}
	
	return 0;
}
