#include<iostream>
using namespace std;
int main()
{
	long long int a, b;
	long long int A, B;
	cin >> a >> b;
	long long int c = a;
	long long int d = b;
	if (a <= b)
	{
		while (a != 0)
		{
			long long int r = b%a;
			b = a;
			a = r;
		}
		A = b;
	}
	if (a > b)
	{
		while (b != 0)
		{
			long long int r = a%b;
			a = b;
			b = r;
		}
		A = a;
	}
	B = c*d / A;
	cout << A << " " << B << endl;
	return 0;
}