#include <iostream>

using namespace std;
long long GCD(long long a,long long b){
	long long ma = max(a,b);
	long long mi = min(a,b);
	while(mi!=0){
		long long temp;
		temp = mi;
		mi = ma % mi;
		ma = temp;
	}
	return ma;
}
long long LCM(long long a,long long b){
	return a*b/GCD(a,b);
}

int main(){
	long long a,b;
	while((cin>>a>>b)){
		cout << GCD(a,b) << ' ' << LCM(a,b) << endl;
	}
}