#include<stdio.h>
int main(){

	long long int a,b,x,y;
	while(~scanf("%lld%lld",&a,&b))
	{
	x=a;
	y=b;
	while(a!=b){
		if(a>b){
			a-=b;
		}
		else{
			b-=a;
		}
	}
	printf("%lld %lld",a,x/a*y);
}	
return 0;
	}