#include <iostream>
#include <cmath>

unsigned int gcd(const unsigned int a, const unsigned int b) {
	unsigned int result = 1;
	unsigned int k = (a < b) ? a : b;

	for (unsigned int k = 1; k <= a and k <= b; k++) {
		if (a % k == 0 and b % k == 0) { result = k; }
	}

	return result;
}

unsigned int lcm(unsigned int a, unsigned int b) {
	unsigned int mult;

	if (a > b) {
		unsigned int tmp = a;
		a = b;
		b = tmp;
	}

	for (unsigned int k = 1; k <= a; k++) {
		mult = b * k;
		if (mult % a == 0) { return mult; }
	}

	return 0;
}

int main() {
	unsigned int a, b;
	
	while (!std::cin.eof()) {
		std::cin >> a >> b;
		std::cout << gcd(a, b) << " " << lcm(a, b) << std::endl;
	}
}