#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

int main()
{
	long long a,b;
	long long tmp=1,tmp_1;

	
	while (cin >> a >> b)
	{

		for (long long i = 1; i <= a; i++)
		{
			if (a%i == 0 && b%i == 0 && tmp < i)
			{
				tmp = i;
			}
			
		}
		tmp_1 = a*b / tmp;

		cout << tmp <<" "<<tmp_1<<endl;
	}

	return 0;
}