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