#include <iostream>
using namespace std;

int GCD(int a, int b){
	if(b == 0){
		return a;
	}
	return GCD(b, a % b);
}

int main(){
	int a, b;
	int i;
	int k;

	while(cin >> a >> b){

		if(a > b){
			i = GCD(a, b);
		}
		else{
			i = GCD(b, a);
		}

		a = a / i;
		b = b / i;

		k = a * b * i;

		cout << i << " " << k << endl;
	}
}