#include <stdio.h>
int GCD(int a,int b){
	int r=a%b;
	if(r==0) return b;
	return GCD(b,r);
}
int main(){
	int a,b,g,l;
	while(scanf("%d%d",&a,&b)!=EOF){
		g = GCD(a,b);
		l = (a/g)*b;
		printf("%d %d\n",g,l);
	}
	return 0;
}