#include <cstdio>
#define LOOP(index,times) for(int index=0;index<times;index++)
using namespace std;

int main(){
long a,b,r;
while(scanf("%ld %ld",&a,&b) != EOF){
	
	long c=a*b;
			
	if(b>a){r=a; a=b; b=r;}

	LOOP(i,a%b!=0){
	r=a%b;
	a=b; b=r;		
	}
	printf("%ld %ld\n",a%b,c/(a%b));
}
return 0;		
}