#include	<iostream>
#include	<cstdio>

using namespace std;

double gcd(int x, int y);

int main(void) {
	while(1) {
		int x, y;
		double G, L;
		cin >> x;
		if( cin.eof() ) { break; }
		cin >> y;
		
		G = gcd(x, y);
		L = (double)x * (double)y / G;
		printf("%.0f %.0f\n", G, L);
	}
	return 0;
}

double gcd(int x, int y) {
	int t;
	while(y != 0) {
		t = x % y;
		x = y;
		y = t;
	}
	return x;
}