#include<stdio.h>

int fun(int a,int b){
	b=b%a;
	if(b==0) return a;
	else fun(b,a);
}

int main(){
	int a,b,gcd,mem;
	long long lcm;
	while(scanf("%d %d",&a,&b)!=EOF){
		if(a>b){
			mem=b;
			b=a;
			a=mem;
		}
		gcd=fun(b,a);
		lcm=a/gcd*b;
		printf("%d %lld\n",gcd,lcm);
	}

}