#include<iostream>

using namespace std;

//Euclidean algorithm
int gcd(long m, long n)
{
	long t;
	while (n != 0) {
		t = n, n = m % n, m = t;
	}
	return m;
}

//gcd(a, b) * lcm(a, b) = a * b
int lcm(long n, long m) {
	return n * m / gcd(n, m); 
}

int main(){
	long m, n;

	while(cin >> m >> n) {
		if(m > n) swap(n, m);
		cout << gcd(n, m) << " " << lcm(n, m) << endl;
	}

	return 0;
}