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

long long GCD(long long X, long long Y) {
	if (Y == 0) return X;
	return GCD(Y, X % Y);
}

int main() {
	long long A, B;
	while (cin >> A >> B) {
		cout << GCD(A, B) << " " << A * (B / GCD(A, B)) << endl;
	}
}
