#include <stdio.h>

int gcd_num;

void gcd(int a, int b){
	int tmp;

	if(a < b){
		tmp = a;
		a = b;
		b = tmp;
	}

	tmp = a % b;
	if(tmp == 0){
		printf("%d ", b);
		gcd_num = b;
	}else{
		gcd(b, tmp);
	}
	return;
}

void lcm(int a, int b){
	printf("%d\n", gcd_num * (a / gcd_num) * (b / gcd_num));
}

int main(void){
	int a, b;
	int tmp;

	while(scanf("%d %d", &a, &b) != -1){
		gcd(a, b);
		lcm(a, b);
	}
}