#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

template <class T>
T gcd(T a, T b)
{
	if (b == 0)
		return a;
	return gcd(b, a%b);
}

int main()
{
	long a, b;
	while (scanf("%ld %ld", &a, &b) != EOF)
	{
		long g = gcd(a, b);
		long l = a/g * b;
		printf("%d %d\n", g, l);
	}

	return 0;
}