#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <sstream>
#include <stdio.h>
using namespace std;

// GCD and LCM(0005)
int GCD(int a, int b)
{
	if (b == 0)
		return a;
	return GCD(b, a%b);
}

int main()
{
	int a, b;
	while (cin >> a >> b) {
		int g = GCD(a, b);
		cout << g << " " << a / g * b << endl;
	}
	return 0;
}