#include <stdio.h>

int main(){
	int a,b,gcd,lcm;
	while(1){
		if (scanf("%d%d",&a,&b)==EOF) break;
		gcd=a;
		while(gcd%b!=0){
				gcd+=a;
		}
		
		lcm=a*b/gcd;
		

		printf ("%d %d\n",lcm,gcd);
	}
	return 0;
}