#include <iostream>
#include <stdio.h>

using namespace std;

__int64 gcd(__int64 a, __int64 b)
{
	if (b == 0)
		return a;
	return gcd(b, a % b);
}

int main()
{
	__int64 a, b, t;
	while (scanf("%I64d%I64d", &a, &b) != EOF)
	{
		if (a < b)
			t = gcd(b, a);
		else
			t = gcd(a, b);
		printf("%I64d %I64d\n", t, a * b / t);
	}
	return 0;
}