#include <iostream>
using namespace std;

int gcd(int a,int b){
	int maxa[2000000000],maxb[2000000000],GCD,i,j;
	
	for(i=2;i<a;i++){
		if(a%i == 0){
			a = a/i;
			for(j=0;j<a;j++)
				maxa[j] = i;
		}
	}
	for(i=2;i<b;i++){
		if(b%i == 0){
			b = b/i;
			for(j=0;j<b;j++)
				maxb[j] = i;
		}
	}
	for(j=0;j<a||j<b;j++){
		if(maxa[j] == maxb[j])
			GCD = maxa[j];
	}
	
	return GCD;
}

int main() {
	int a, b;
    while(cin >> a >> b) {
      int lcm = a*b/gcd(a,b);
      cout << gcd(a,b) << " " << lcm << endl;
    }

	return 0;
}
