#include <algorithm>
#include <sstream>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <stack>
#include <stdio.h>
#include <string>
#include <queue>
#include <vector>
using namespace std;

long long int gcd(long long int a, long long b) {
	if (a == 0 || b == 0) return 0;
	if (a % b == 0) return b;

	return gcd(b, a % b);
}

int main()
{
	long long int a, b, x;
	while (cin >> a >> b && a != EOF) {
		x = gcd(a, b);
		cout << x << " " << a * b / x << endl;
	}
}

