#include <stdio.h>

template <typename T>
T gcd(T a, T b){
	T r;
	while(b > 0){
		r = a % b;
		a = b;
		b = r;
	}
	return a;
}
template <typename T>
inline T lcm(T a, T b){
	return a / gcd(a, b) * b;
}

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

	return 0;
}