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

LL gcd(LL a, LL b) { return b ? gcd(b, a%b) : a; }

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