#include <iostream>

#define CASE long int

using namespace std;

CASE GCD(CASE x, CASE y)
{
	if (x == 0 || y == 0)
		return x + y;
	else
	{
		if (x >= y)
		{
			x = x - y;
			GCD(x, y);
		}
		else
		{
			y = y - x;
			GCD(x, y);
		}
	}
}

int main(){
	CASE a, b;
		cin >> a;
		cin >> b;
		cout << GCD(a, b) << " " << a * b / GCD(a, b) << endl;
	return 0;
}