#include <stdio.h>

int main(void) {
	int buf,i,c;
	long int a,b,gcd = 1, lcm;
	
	while(scanf("%ld%ld",&a,&b) != EOF){
		if(b > a){buf = a;a = b;b = buf;}
		for(i = 2; a/2 > i;i++){
			if(b%(a/i) == 0) {gcd = a/i;break;}
		}
		for(i = 2; ;i++){
			if((a*i)%b == 0) {lcm = a*i;break;}
		}
		printf("%d %d\n",gcd, lcm);
	}
	
	return 0;
}