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