import std.stdio, std.numeric;
void main() {
	ulong a, b, x, r;
	while ("%d %d\n".readf(&a, &b)) {
		if (a < b) {
			auto tmp = b;
			b = a;
			a = b;
		}
		x = a * b;
		r = gcd(a, b);
		"%d %d".writefln(r, x/r);
	}
}