#include <iostream>
#include <algorithm>

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){
	while(1){
		if(a == 0) return b;
		b %= a;
		if(b == 0) return a;
		a %= b;
	}
}

int lcm(int a, int b){
	int tmp = gcd(a, b);
	return tmp ? (a / tmp * b):0;
}