#include <iostream>
using namespace std;
int main(){
	long long a, b, m, n, r;
	while(cin >> a >> b){
		if(a > b){
			m = a;
			n = b;
				while((r = m % n) != 0){
					m = n;
					n = r;
				}
			cout << n << " " << (a * b)/ n << endl;
		}
		else if(a < b){
			m = b;
			n = a;
				while((r = m % n) != 0){
					m = n;
					n = r;
				}
			cout << n << " " << (a * b)/ n << endl;
		}
		else if(a = b){
			cout << a << " " << a << endl;
		}
	}
	return(0);
}