#include<stdio.h>
int main(void)
{
    int  i,a,b,c,x,y;
	
	while(scanf("%d %d",&a,&b)!=EOF){
		x=a;	y=b;
		if(a<b){
			c=a;
			a=b;
			b=c;
		}
		c=a%b;
		while(c!=0){
			a=b;
			b=c;
			c=a%b;
		}
		i=x/b*y;
		printf("%d %d\n",b,i);
	}
	return 0;
}