#include <iostream>

using namespace std;

int main()
{
	int a, b, c, r;
	int gcd, lcm;

	while (cin >> a >> b){
		if (b > a){
			c = a; 
			a = b; 
			b = c;
		}

		lcm = a * b;
		while (1){
			r = a % b;

			if (r == 0){
				break;
			}

			gcd = r;
			a = b;
			b = r;
		}

		lcm /= gcd;
		cout << gcd << " " << lcm << endl;
	}

	return 0;
}