#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<math.h>
#define L(_i,_N) for(int _i=0;_i<_N;_i++)
#define C(_Dis) cout<<_Dis<<endl;

using namespace std;

typedef long long int lli;

int main() {
	lli a, b,c,i;
	while (cin >> a >> b) {
		if (a > b) swap(a, b);
		c = a*b;
		while (1){
			if (b == 0) break;
			i = b;
			b = a%b;
			a = i;
		}
		cout << a << " " << c / a  << endl;
	}
	return 0;
}