#include<iostream>
#include<vector>
using namespace std;

int gcd(unsigned long int m,unsigned long int n) {
	if (n == 0)return m;
	while (m%n != 0) {
		m = m%n;
		swap(m, n);
	}
	return n;
}

int main() {
	unsigned long int a, b; vector<unsigned long int> GCDS; vector<unsigned long int> LCMS;
	while(cin>>a>>b) {
		GCDS.push_back(gcd(a, b));
		LCMS.push_back(a / gcd(a, b)*b);
	}
	for (int i = 0; i < GCDS.size(); i++) {
		cout << GCDS[i] << ' ' << LCMS[i] << endl;
	}
}