#include <stdio.h>

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

}