#include<stdio.h>
int main(void)
{
	int a,b,x,y,s;
	int i,temp;

	while(scanf("%d %d",&a,&b)!=EOF){
		x=a;
		y=b;
		if(a<b){
			
			temp=a;
			a=b;
			b=temp;
		}
		while(b!=0){
			a=a%b;
			temp=a;
			a=b;
			b=temp;
		}
		x=x/a;
		y=y/a;
		s=a*x*y;
		printf("%d %d\n",a,s);
	}
	return 0;
}

		