#include <iostream>
#include <cstdio>

unsigned long gcd(unsigned long a, unsigned long b)
{
	return (a % b == 0) ? b : gcd(a, a % b);
}

unsigned long lcm(unsigned long a, unsigned long b)
{
	return a / gcd(a, b) * b;
}

int main()
{
	unsigned long a, b;
	while (std::cin >> a >> b) {
		std::cout << gcd(a, b) << " " << lcm(a, b) << "\n";
	}

	return 0;
}