#include <iostream>
#include <cstdio>

using namespace std;
 
int saidai(int a, int b);
int saisho(int a, int b);

int main(){
	int a, b;

	while(cin >> a >> b){
		if(a<b) swap(a,b);
		
		cout << saidai(a, b) << " " << saisho(a,b) << endl;
	}
}

int saidai(int a, int b){
	
	int x=1;
	for(int i=2; i<=a; i++){
		while(1){
		if(a%i == 0 && b%i == 0){
			 x = x * i;
			 a =a/i;
			 b =b/i;
		}
		 else break;
		}
	}

	return x;
}

int saisho(int a, int b){

	int y=1;
	for(int i=2; i<=a; i++){
		while(1){
		if(a%i == 0 && b%i == 0){
			 y = y * i;
			 a =a/i;
			 b =b/i;
		}
		 else break;
		}
	}

	y = y * a * b;

	return y;
}



