#include <cstdio>

using namespace std;
int gcd(int x, int y) {
	while(y) {
		int t = x%y;x=y;y=t;
	}
	return x;
}

int main() {
	while(true) {
		int a,b;
		if(scanf("%d%d", &a, &b)<2)break;
		int g = gcd(a,b);
		int l = a/g*b;
		printf("%d %d\n", g, l);
	}
	return 0;
}