#include <stdio.h>

int main(void){
	long a=0, b=0;
	long x=0;
	long m=0, n=0;
	while(scanf("%d %d", &a, &b) != EOF){
		if(a>=b){
			m=a;n=b;
		}else{
			m=b;a=n;
		}
		while(n != 0){
			x = n;
			n = m % n;
			m = x;
		}
		printf("%d %d\n", m, a/m*b);
	}
	return 0;
}