#include <iostream>
#include <iomanip>
using namespace std;

void GetGCD(int a, int b, int& GCD)
{
	if(a == 0){
		GCD = b;
		return;
	}
	if(b == 0){
		GCD = a;
		return;
	}
	if(a >= b){
		a = a % b;
	}else{
		b = b % a;
	}
	GetGCD(a, b, GCD);
}

int main()
{
	while(true){
		int a, b;
		cin >> a >> b;
		if(cin.eof()) break;
		int GCD;
		GetGCD(a, b, GCD);
		int LCM = a * (b / GCD);
		cout << GCD << ' ' << LCM << endl;
	}
	return 0;
}