
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#define pi 3.14159265358979323846264338
using namespace std;

int main() {
	int n, m;
	while (cin >> n >> m) {
		long long a = n, b = m,keep;
		while (a != b) {
			keep = min(a, b);
			b = max(a, b) - min(a, b);
			a = keep;
		}
		cout << a << " " << n/a*m << endl;
	}
	return 0;
}