#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <algorithm>
#include <iomanip>
#include <functional>

#define REP(i, n) for(int i = 0;i < (n); i++)
#define REP2(i, x, n) for(int i = (x); i < (n); i++)
#define REPR(i, n) for(int i = (n); i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

#define LL long long int
#define LD long double

#define PI 3.14159265358979

using namespace std;

LL gcd(LL m, LL n)
{
	if ((0 == m) || (0 == n)) return 0;

	while (m != n)
	{
		if (m > n) m = m - n;
		else         n = n - m;
	}
	return m;
}

LL lcm(LL m, LL n)
{
	if ((0 == m) || (0 == n)) return 0;

	return ((m / gcd(m, n)) * n);
}

//================================================
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	LL A, B;
	while (cin >> A >> B) {
		if (A < B) {
			A = B;
			B = A;
		}
		cout << gcd(A, B) << " " << lcm(A, B) << endl;
	}
	return 0;
}