#include<cstdio>
long int GCD(long int a,long int b){
	if(a < b){
		long int bf = a;
		a = b;
		b = bf;
	}
	while(b != 0){
		long int mod = a % b;
		a = b;
		b = mod;
		//printf("mod = %ld\n",mod);
	}
	return a;
}

int main(){
	long int a,b;
	while(scanf("%ld %ld",&a,&b) != EOF){
		long int gcd = GCD(a,b);
		long int lcm = (a/ gcd) * b;
		printf("%ld %ld\n",gcd,lcm);
	}
	return 0;
}