// 2011/05/31 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int a, b;
		cin >> a;
		if(cin.eof())
			break;
		cin >> b;

		int m, n;
		if(a>=b){
			m = a;
			n = b;
		}
		else{
			m = b;
			n = a;
		}

		while(m%n!=0){
			int tmp = n;
			n = m%n;
			m = tmp;
		}

		int gcd = n;
		int lcd = a/gcd*b;

		cout << gcd << ' ' << lcd << endl;
	}

	return 0;
}