#include <stdio.h>

int main(void) {
	int a, b, x, y, n, m, max, i;
	while(scanf("%d %d", &a, &b) != EOF){
		if(a < b){
			n = a;
			m = b;
		}
		else{
			n = b;
			m = a;
		}
		for(i = 1; i <= n; i++){
			if(a % i == 0 && b % i == 0) x = i;
		}
		max = a * b;
		y = max / x;
		printf("%d %d\n", x, y);
	}
	return 0;
}