#include <iostream>

using namespace std;

int gcd(int, int);
int lcm(int, int);

int main(void){
	for(int a, b; cin >> a >> b; cout << gcd(a, b) << " " << lcm(a, b) << endl);

	return 0;
}

int gcd(int a, int b){
	if(a < b) swap(a, b);
	while(a = a % b){
		if(a < b) swap(a, b);
	}
	return b;
}

int lcm(int a, int b){
	return a / gcd(a, b) * b;
}