#include<cstdio>
#include<iostream>
using namespace std;
#define ull unsigned long long
ull a, b, ans;

ull gcd(ull a, ull b){
	return b == 0 ? a : gcd(b, a % b);
}

ull lcm(ull a, ull b, ull GCD){
	a = a / GCD;
	b = b / GCD;
	return a * b * GCD;
}


int main(){
	while(cin>>a>>b){
		ans = gcd(a, b);
		cout<<ans<<" "<<lcm(a, b ,ans)<<endl;
	}
	return 0;
}
