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



int main(void){
	//GCD=?????§??¬?´???°
	//LCM=????°???¬?????°

	long int a, b,Max,Min,GCD,LCM,count;


	while (cin>>a>>b){
		count = 0;
		Max = max(a, b);
		Min = min(a, b);
		//GCD

		//????°????????????£????????£????????????????????????????????§??¬?´???°??§??????
		for (int i = 1;;i++){

			if (Min %i == 0 && Max%(Min/i)==0){//?????????????????????
				GCD = Min/i; 
				count++;
			}		
			if (count == 1)break;
		}

		//LCM

		for (int i = 1;; i++){
			if ((Max*i) % Min == 0){
				LCM = (Max*i);
				count++;
			}if (count == 2)break;
		}


		cout << GCD << " " << LCM << endl;
	
	}
	
	
	return 0;
}