#include <iostream>
#include <vector>
using namespace std;

int main(){
		long long a, b, gcd, lcm;
		while(cin >> a >> b){
				vector<long long> divisor_a;
				vector<long long> divisor_b;
				for(int i = 2; i <= a; i++){
						if(a % i == 0) divisor_a.push_back(i);
				}
				for(int i = 2; i <= b; i++){
						if(b % i == 0) divisor_b.push_back(i);
				}
				for(int i = 0; i < divisor_a.size(); i++){
						for(int j = 0; j < divisor_b.size(); j++){
								if(divisor_a[i] == divisor_b[j]) gcd = divisor_a[i];
						}
				}
				lcm = a / gcd * b;
				cout << gcd << " " << lcm << endl;
		}
		return 0;
}