#include <cstdio>
int gcd (int a, int b) {
	while (true) {
		if (a > b)
			a -= b;
		else if (a < b)
			b -= a;
		else
			break;
	}
	return a;
}
int lcm (int a, int b) {
	int sum_a = a;
	int sum_b = b;
	while (true) {
		if (sum_a > sum_b)
			sum_b += b;
		else if (sum_a < sum_b)
			sum_a += a;
		else
			break;
	}
	return sum_a;
}
int main ( int argc, char *argv[] ) {
	using namespace std;
	int a, b;
	while (EOF != fscanf(stdin, "%d %d\n", &a, &b)) {
		printf("%d %d\n", gcd(a, b), lcm(a, b));
	}
	return 0;
}