#include <iostream>
using namespace std;
int GCDr(int x,int y,int n,int d) {
	if (x % n == 0 && y % n == 0) {
		return n;
	}
	else {
		return d;
	}
}
int main() {
	int a, b;
	while (cin >> a >> b){
		int i, GCD, LCM;
		GCD = 0;
		if (a == b) {
			GCD = a;
			LCM = a;
		}
		else {
			if (a > b) {
				swap(a, b);
			}
			for (i = 1; i <= a || i <= b / 2; i++) {
				GCD = GCDr(a, b, i, GCD);
			}
			GCDr(a, b, i, GCD);
			LCM = a * b / GCD;
		}
		cout << GCD << " " << LCM << endl;
	}
}