#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<tuple>
#include<utility>
#include<stack>
#include<set>
#include<iomanip>
using namespace std;
using ll=long long int;

ll gcd(ll p, ll q) {
	ll r = p % q;
	while (r != 0) {
		p = q;
		q = r;
		r = p % q;
	}
	return q;
}

ll lcm(ll p, ll q) {
	return p * q / gcd(p, q);
}

int main() {
	ll a, b;
	while (cin >> a >> b) {

		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
	return 0;
}

