#include <iostream>
using namespace std;

int main(){
	int a, b;
	int m, n, r;
	while(cin >> a >> b){
		m = max(a, b);
		n = min(a, b);
		r = m % n;

		while(r != 0){
			m = n;
			n = r;
			r = m % n;
		}

		cout << n << ' ' << min(a,b)*(max(a,b)/n) << endl;
	}

	return(0);
}