#include <iostream>
#include <math.h>
using namespace std;
int main() {
	while (1) {
		int a, b, i, GCD, LCM;
		cin >> a >> b;
		for (i = 1; i <= a || i <= b; i++) {
			if (a % i == 0 && b % i == 0) {
				GCD = i;
			}
		}
		LCM = a * b / GCD;
		cout << GCD << " " << LCM << endl;
	}
}