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

int GCD(int a, int b)
{
	int max = 0, c = (a < b) ? b : a;
	for (int i = 1; i <= c; ++i) {
		if (a%i == 0 && b%i == 0)max = i;
	}
	return max;
}

int LCM(int a, int b)
{
	return a*b / GCD(a, b);
}

int main(int argc, char **argv)
{
	int a, b;
	while (cin >> a >> b)
		cout << GCD(a, b) << " " << LCM(a, b) << endl;
	
	return 0;
}