#include<iostream>

using namespace std;

long saidai(long a,long b){

	for(long i=a ;i>0 ;i-- ){
		
		if(a%i==0 && b%i==0){
			return i;
			break;
		}
	}
}

long saisho(long a,long b){
	long t;
	//t=a*b;
	for(long i=a ;i<=2000000000 ;i++){
		if(i%a==0 && i%b==0){
			return i;
			break;
		}
	}
	//return a*b;
}

int main(){
	long a,b;

	while(cin >> a >> b){

	cout << saidai(a,b) << " " << saisho(a,b) << endl;
	}
	return 0;
	
}