#include <bits/stdc++.h>
using namespace std;
long gcd(long n,long m){
	if (m == 0) return n;
	return gcd(m, n % m);
}

long lcm(long n, long m) {
	return m / gcd(n, m)*n;
}

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