#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int gcd (int a, int b)
{
	if (a > b){
		swap(a,b);
	} // end if
	while (b % a != 0){
		b = b % a;
		if (a > b){
			swap(a,b);
		} // end if
	} // end while

	return a;
}
long lcm (int a, int b)
{
	long res = a/gcd(a,b);
 	res *= b;
	return res;
}
int main()
{
//	cut here before submit 
//	freopen("testcase.gl", "r", stdin);
	string str = "";

	while (getline (cin, str )){
		int a, b;
		stringstream ss(str);
		ss >> a >> b;
		cout << gcd(a,b) << ' ' << lcm(a,b) << endl;
	} // end for

	return 0;
}