#include<cstdio>
#include<iostream>
#include <algorithm>

using namespace std;

int main() {
	long int  a, b;
	while (cin >> a >> b) {
		cout << __gcd(a, b) << " " << a / gcd(a, b) * b << endl;

	}

}