#include <iostream>
#include <stack>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
using namespace std;

int main() {
	int a, b;
	int x, y;
	int c;
	c = 0;

	while (cin >> a) {
		cin >> b;
		long long int m = a;
		long long int n = b;
		int r1, r2;
		int gcd, lcm;
		
		if (a < b) {
			c = a;
			a = b;
			b = c;
		}
		r1 = a % b;
		r2 = r1;

		while (r2 != 0) {
			r1 = r2;
			r2 = b % r1;
			b = r1;
		}
		gcd = b;
		lcm = (m * n) / gcd;

		cout << gcd << " " << lcm << endl;

	}

	return 0;
}
