#include"bits/stdc++.h"
using namespace std;

#define ll long long
#define INF INT_MAX/3
#define pi 2*acos(0.0)
#define eps 1e-14

const int MAX_N = 1e+3;
const int MAX_M = 1e+2;
ll a, b;
void input()
{
	scanf("%lld%lld", &a, &b);
}

ll euclid(ll x, ll y) {
	if (y == 0) return x;
	return euclid(y, x%y);
}
int main() {
	while (cin >> a >> b) {
		ll gcd = euclid(a, b);
		ll lcm = a*b / gcd;
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}