#include <iostream>
using namespace std;
 
int main() {
	long a,b;
	while (cin>>a>>b){
		long c = a;
	    long d = b;
	while (true) {
		if(c % d == 0) break;
		long e = d;
		d = c % d;
		c = e;
	}cout<<d<<" "<<a*b/d<<endl;
	}
}