#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>

using namespace std ;

long long a, b, Gcd;

void gcd(int a, int b) {
	if (a < b) swap(a,b);
	while (a % b != 0) {
		a %= b;
		swap(a, b);
	}
	Gcd = b;
}

long long lcm(long long a , long long b) {
	return a * b / Gcd;
}

int main() {
	while (cin >> a >> b) {
		gcd(a, b);
		cout << Gcd << " " << lcm(a, b) << endl ;
	}
	return 0 ;
}
