#include<stdio.h>

typedef unsigned long long ULL;

ULL gcd(ULL m,ULL n){
	
	return n==0?m:gcd(n,m%n);	
}
ULL lcm(ULL m,ULL n){
	
	return m/gcd(m,n)*n;
}

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