#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long ll;

template<class T>
T gcd(T a,T b){
	while(a % b != 0){
		T buf = b;
		b = a%b;
		a = buf;
	}
	return b;
}

int main(){
	ll a,b;
	while(cin>>a>>b){
		ll g = gcd(a,b);
		ll l = a / g * b;

		cout << g << " " << l << endl;
	}
	return 0;
}