#include <iostream>
using namespace std;

void swap(int& a, int& b) {
	int tmp = a;
	a = b;
	b = tmp;
}

void calcGCD(int& gcd, const int a_, const int b_) {
	int a = a_;
	int b = b_;
	int r = a % b;
	if(r == 0) {
		gcd = b;
	} else {
		a = r;
		if(a < b) {
			// swap to set a >= b
			swap(a, b);
		}
		calcGCD(gcd, a, b);
	}
}

void calcLCM(int& lcm, const int gcd, const int a, const int b) {
	lcm = (int)((double)a * b / gcd);
}

int main(){
	int a, b;
	while(cin >> a >> b) {
		if(a < b) {
			swap(a, b);
		}
		int gcd;
		int lcm;
		calcGCD(gcd, a, b);
		calcLCM(lcm, gcd, a, b);
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}