#include <cstdio>

using namespace std;

int a, b;
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }

int main() {
	while(scanf("%d%d", &a, &b) != EOF) {
		int gcd = GCD(a, b);
		printf("%d %d\n", gcd, a / gcd * b);
	}
	return 0;
}