#include <iostream>

using namespace std;

int gcd(int a, int b){
	if((0 == a) || ( 0 == b)) return 0;
	
	while( a != b){
		if( a > b) a = a - b;
		else       b = b - a;
	}
	return a;
}

int lcm(int a, int b){
	if((0 == a) || ( 0 == b)) return 0;
	
	return ((a / gcd(a,b)) * b);
}

int main(){
	int a, b;
	
	while(cin >> a >> b){
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
		
	return 0;
}