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