#include <cstdio>

long long gcd(long long a,long long b){
	long long aa,bb;
	while(1){
		if(b == 0){ return a; }
		aa = b;
		bb = a % b;
		a = aa;
		b = bb;
	}
}

long long lcm(long long a,long long b){
	return a * b / gcd(a,b);
}

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