#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main() {
	long long a, b;
	while (cin>>a>>b) {
		long long G=a,L=b;
		if (G < L)swap(G, L);
		while (G%L != 0) {
			G = G - L*(G/L);
			if(G < L)swap(G, L);
			//cout<<G<<" "<<L<<endl;
		}
		G=min(G,L);
		L=a*b/G;
		cout << G << " " << L << endl;
	}
	return 0;
}