#include <iostream>
using namespace std;

long gcm(long a, long b){
	if (a<b) swap(a, b);

	if (a%b == 0)
		return b;
	else
		return gcm(b, a % b);
}

int main(void){

	while (true){
		long a, b, x, y;
		cin>>a>>b;
		if (cin.eof()) break;

		x = gcm(a, b);
		y = a / x * b;
		cout<<x<<" "<<y<<endl;
	}
	return 0;
} 