#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

long long gcd(long long a, long long b) {
	return b ? gcd(b, a % b) : a;
}
long long lcm(long long a, long long b) {
	return a / gcd(a, b) * b;
}

signed main() {
	int a, b;
	while (cin >> a >> b) {
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
	return 0;
}
