#include <iostream>
#include <stdio.h>
#include <numeric>
#include <algorithm>
#include <cmath>

using namespace std;

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

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

int main(void)
{

	long int a, b;
	long int x, y;

	while (cin >> a >> b)
	{
		x = gcd(a, b);
		y = lcm(a, b);

		cout << x << " " << y << endl;
	}
	return 0;

}
