#include<iostream>
using namespace std;

//最大公約数(greatest common divisor)と最小公倍数(least common multiple)を計算する関数
void lcm_gcd(long int a, long int b){
	long int i;
	long int x = 1;
	while(1){
		for(i=2;i < a;i++){
		if(a % i == 0 && b % i == 0){
		a /= i;
		b /= i;
		x *= i;
			}
		}
		if(i == a){
		cout << x  << " " << x * a * b << endl;
		break;
		}
		
		
	}
}
			
int main(){
	long int a, b;
	while(cin >> a >> b){
		lcm_gcd(a,b);
	}
	return 0;
}