#include<iostream>
using namespace std;
int main() {
	long long a, b, c,d,e,A,B,C;
	c = 9;
	d = 9;
	e = 9;
	C = 9;
	while (cin >> a >> b) {
		if (a < b) { swap(a, b); }
		A = a;
		B = b;
		while (1) {
			if (c == 0) { break; }
			c = a%b;
			a = b;
			b = c;
		}
		d = A / a;
		e = B / a;
		C = a*d*e;
		cout << a << ' ' << C << endl;
	}
	return 0;
}