#include <iostream>

int GCD(int a, int b) {
	int c = std::max(a, b),
		d = std::min(a, b);
	while (c != d) {
		c -= d;

		int tmp[] = {c, d};
		c = std::max(tmp[0], tmp[1]);
		d = std::min(tmp[0], tmp[1]);
	}

	return c;
}

int main() {
	int a, b;
	while (std::cin >> a >> b) {
		int gcd = GCD(a, b);
		std::cout << gcd << " " << a * b / gcd << std::endl;
	}
}