#include<iostream>
using namespace std;
int main(){
int a,aaa,bbb, b, aa[100], bb[100], r,kazu,m;
kazu = 0;
while (cin >> aaa >> bbb) {
	kazu++;
	m = aaa * bbb;
	a = aaa;
	b = bbb;
	if (a <= b) {
		r = a;
		a = b;
		b = r;
	}
	while (b != 0) {
		r = a % b;
		a = b;
		b = r;
	}
	aa[kazu] = a;
	if (m > 0) {
		bb[kazu] = m / aa[kazu];
	}
	else {
		m = aaa / aa[kazu];
		bb[kazu] = m * bbb;
	}
}
for (int i = 1; i <= kazu; i++) {
	cout << aa[i] << " " << bb[i] << endl;
}
}
