#include <stdio.h>

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

}