#include <iostream>
using namespace std;

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