#include<iostream>

using namespace std;

int main() {
	long a, b;
	long ans[2];
	while (cin >> a >> b) {
		if (a > b) {
			long temp = a;
			a = b;
			b = temp;
		}

		long i = 1;
		while ( (b * i) % a != 0 ) {
			i++;
		}
		ans[1] = b * i;

		long n = b, m = a, r = 1;

		while (r!=0){
			r = n % m;
			n = m;
			m = r;
		}
		ans[0] = n;

		cout << ans[0] << " " << ans[1] << endl;
	}
}
