#include <iostream>
#include <math.h>
using namespace std;
#define ep 0.00001

int main()
{
	int a, b, temp;
	int a0, b0;
	int a1, b1;
	int gcd, lcm;
	
	while (cin >> a >> b) {
		if (a > b) {
			temp = a;
			a = b;
			b = temp;
		}
		a0 = a;
		b0 = b;
		while (a0) {
			temp = b0 % a0;
			b0 = a0;
			a0 = temp;
		}
		gcd = b0;
		a1 = a;
		b1 = b;
		while (a1 != b1) {
			if (a1 < b1)
				a1 += a;
			else if (a1 > b1)
				b1 += b;
		}
		lcm = a1;
		cout << gcd << " " << lcm << "\n";
	}
	return 0;
}