#include <stdio.h>

int main (void){
	int a, b, i, j, breeeeak, c;
	while(scanf("%d%d", &a, &b)!=EOF){
		breeeeak=0;
		for(i=2;;i++){
			for(j=2;;j++){
				if(i*a<j*b){
					break;
				}
				if(i*a==j*b){
					breeeeak=1;
					c=i*a;
					break;
				}
			}
			if(breeeeak){break;}
		}
		
		printf("%d %d\n", a*b/c, c);
	}
	return 0;
}