#include<stdio.h>
int GCD (int a, int b) {
	return b ? GCD (b, a % b) : a;
}
int LCM (int a, int b) {
	return a / GCD (a, b) * b;
}
int main () {
	int a, b;
	while (~scanf("%d%d", &a, &b)) {
		printf("%d %d\n", GCD(a, b), LCM (a, b));
	}
	return 0;
}