#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include <functional>
#include <iomanip>
using namespace std;

#define ll long long int

#define rep(p,q) for(int i = p; i < q;i++)

int gcd(ll a, ll b) {
	if (a < b) {
		ll swap = a;
		a = b;
		b = swap;
	}
	int c = a % b;
	if (c == 0) return b;
	else gcd(b, c);
}

//5
int main(void) {
	ll a, b;
	while (cin >> a >> b) {
		ll g = gcd(a, b);
		ll l = a * b / g;
		cout << g << " " << l << endl;
	}
}

