#include <iostream>
//include <algorithm>
using namespace std;
int main(){
	int a, b;
	while( cin >> a >> b ){
		int gcd = 1, lcm;
		//cout << max(a,b) << endl;
		for( int i = 2; i < a; i++ ){
			if( a%i == 0 && b%i == 0 ){
				gcd = i;
			}
		}
		lcm = (a / gcd) * b;
		cout << gcd << ' ' << lcm << endl;
	}
}