#include <stdio.h>
using namespace std;

int gcd(long num1,long num2) {
	if (num2 == 0) {
		return num1;
	}return gcd(num2, num1 % num2);
}

int lcm(long num1,long num2) {
	return num1 / gcd(num1, num2) * num2;
}

int main() {
	long a, b;
	while (scanf("%d %d",&a,&b)!=EOF) {
		printf("%d %d\n", gcd(a, b),lcm(a,b));
	}
}
