#include <stdio.h>

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

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