#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a, b;
	while (cin >> a >> b){
		int gcd;
		int aa = max(a, b);
		int bb = min(a, b);
		while (true){
			if (aa % bb == 0) {
				gcd = bb;
				cout << gcd << ' ';
				goto C;
			}
			else{
				int tmp = aa - bb;
				aa = bb;
				bb = tmp;
			}
		}
	C:
		cout << a*b / gcd << endl;
	}
}