#include <iostream>

using namespace std;

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

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

		while(1){
			r = a % b;
			if (r == 0){
				break;
			}
			a = b;
			b = r;
		}
		gcd = b;
		x /= gcd;
		y /= gcd;

		cout << gcd << " " << x * y * gcd << endl;
	}

	return 0;
}