#include <iostream>
#include <sstream>
#include <vector>

using namespace std;

int getcom(int x, int y) {
	int no = 2;

	while (true) {
		if (no > x || no > y) {
			return 1;
		}

		if (x % no == 0 && y % no == 0) {
			x = x / no;
			y = y / no;
			return no * getcom(x, y);
		}
		no++;
	}
}

int main(void) {
	int a, b;

	vector<string> v;
	while (cin >> a >> b) {
		int com_div, com_mlt;

		com_div = getcom(a, b);
		com_mlt = (a / com_div) * (b / com_div) * com_div;
		stringstream ss;
		ss << com_div << " " << com_mlt;
		v.push_back(ss.str());
	}

	for (int i = 0; i < v.size(); i++) {
		cout << v[i] << endl;
	}

	return 0;
}