#include <stdio.h> 
#include <algorithm>

typedef long long LL;

LL GCD(LL a, LL b){
	if (a<b) std::swap(a, b);
	LL lcm = a * b; 
	while (b != 0)  { 
		LL gcd = a % b; 
		a = b; 
		b = gcd; 
	} 
	return a;
}

int main(){
	LL a, b;
	while (~scanf("%lld%lld", &a, &b)){
		LL tmp = GCD(a, b);
		printf("%lld %lld\n", tmp, a*b/tmp);
	}
	return 0;
}