#include<iostream>

using namespace std;


int main() {
	unsigned long long n, m,r,tempn,tempm;
	while (cin >> n >> m) {
		tempn = n, tempm = m;
		if (n < m) { int t = n; n = m; m = t; }
		while (m) {
			r= n % m;
			n = m;
			m = r;
		}
		cout << n << ' ';
		int i;
		for (i = 1; (i*tempn) % tempm != 0; ++i);
			cout << tempn * i << endl;

	}
	return 0;
}
