#include<iostream>
#include<algorithm>
#define LL long long

LL gcd(LL a, LL b) {
	if (a < b)std::swap(a, b);
	if (a%b != 0)gcd(b, a%b);
	else return b;
}

int main() {
	LL A, B;
	while (std::cin >> A >> B) {
		LL g = gcd(A, B);
		std::cout << g << " " << (A*B) / g << std::endl;
	}
	return 0;
}
