#include <iostream>

using namespace std;

int a, b;
int g, l;

int gcd(int a, int b)
{
	if(b == 0) return a;
	
	int r;
	r = a % b;
	return gcd(b, r);
}

int main(void)
{
	while(1){
		if(cin.eof()) break;
		cin >> a >> b;
		
		g = gcd(a, b);
		l = a / g * b;
		cout << g << " " << l << endl;
	}
	return 0;
}