#include <stdio.h>

long long gcd(long long,long long);

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

	return 0;
}
long long gcd(long long a,long long b){
	if(b == 0)	return a;
	return gcd(b,a % b);
}