import std.stdio;
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 = a % b;
		while (r != 0) {
			a = b;
			b = r;
			r = a % b;
		}
		"%d %d".writefln(b, x/b);
	}
}