#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


int main(void)
{
	int a, b,r,i,small,big,x;

	while (scanf("%d %d", &a, &b) != EOF){
		if (a > b){
			small = b;
			big = a;
		}
		else {
			small = a;
			big = b;
		}

		//?????§??¬?´???°
		r = big % small;
		while (1){
			x = small % r;
			if (x == 0){
				printf("%d ", r);
				break;
			}
			r = x;
			small = r;
		}
		//????°???¬?????°
		r = big % small;
		while (r != 0){
			big = small;
			small = r;
			r = big % small;
		}
		
		printf("%d\n", (a * b) / small);
	}
	return 0;
}