/*
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0005
 */
#include <iostream>
#include <sstream>

#define N 2

using namespace	std;

long
gcd(long a, long b)
{
	return a % b == 0 ? b : gcd(b, a % b);
}
long
lcm(long a, long b)
{
	long t = gcd(a, b);
	return t ? (a * b) / t : 0;
}
int
main()
{
	string line;
	while (getline(cin, line)) {
		istringstream iss(line);
		long a, b;
		iss >> a >> b;
		cout << gcd(a, b) << ' ' << lcm(a, b) << endl;
	}
	return 0;
}