#include <stdio.h>

int gcd(int,int);

int main(void){
	long a,b;
	long divi,multi;
	while(scanf("%ld %ld",&a,&b) != EOF){
		divi = gcd(a,b);
		multi = a*(b / divi);
		printf("%ld %ld\n",divi,multi);
	}
	return 0;
}

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