#include <stdio.h>

int main(void){
	int x, y;
	int tx, ty;
	int gcd, lcm;

	while(scanf("%d %d", &x, &y) != EOF){
		tx = x;
		ty = y;
		int r;

		while((r = x % y) != 0){
			x = y;
			y = r;
		}

		gcd = y;
		lcm = tx /gcd * ty;

		printf("%d %d\n", gcd, lcm);
	}

	return 0;
}