#include <iostream>
#include <algorithm>
#include <cstdint>

std::uint32_t calc_gcd(std::uint32_t a, std::uint32_t b)
{
	if (a % b == 0) {
		return b;
	}
	return calc_gcd(b, a % b);
}

int main()
{
	std::uint32_t a, b;
	while (std::cin >> a >> b) {
		std::uint32_t const gcd = calc_gcd(std::max(a, b), std::min(a, b));
		std::uint32_t const lcm = a / gcd * b;
		std::cout << gcd << ' ' << lcm << std::endl;
	}
	return 0;
}