#include <iostream>

int main(void)
{
	uint32_t a = 0;
	uint32_t b = 0;

	while (std::cin >> a >> b)
	{
		uint32_t a2 = a;
		uint32_t b2 = b;
		if (a < b)
		{
			uint32_t tmp = a;
			a = b;
			b = tmp;
		}
		uint32_t r = 0;
		while (r = (a % b))
		{
			if (r == 0)
			{
				break;
			}
			a = b;
			b = r;
		}
		std::cout << b << " " << a2/b*b2 << std::endl;
	}

	return 0;
}