#include <stdio.h>
#include <iostream> 
#include <math.h>

using namespace std;

int main() {
	int a, b;
	int MAX, MIN;
	int kari;
	int GCD, LCM;
	while (cin >> a >> b) {
		MAX = max(a, b);
		MIN = min(a, b);
		while(1) {
			kari = MAX % MIN;
			if(kari == 0) {
				GCD = MIN;
				break;
			}
			MAX = MIN;
			MIN = kari;
		}

		LCM = (a / GCD) * (b / GCD) * GCD;

		printf("%d %d\n", GCD, LCM);
	}
	return 0;
}