#include <iostream>
using namespace std;

long gcd(long a, long b)
{
	if(b == 0) return a;
	else return gcd(b, a%b);
}

int main(void)
{
	long a, b;

	while(cin >> a >> b) {
		long G, L;
		
		G = gcd(a, b);
		L = a / G * b;
		cout << G << " " << L << endl;
	}

	return 0;
}