#include<iostream>
#include<algorithm>
#define LL long long
int main() {
	LL a, b;
	while (std::cin >> a >> b) {
		LL gcd = __gcd(a, b);
		std::cout << __gcd(a,b) << " " << (a*b) / gcd << std::endl;
	}
	return 0;
}
