#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int *a, *b, p, q, i;
	a = &p;
	b = &q;
	while(cin >> p >> q){
		for(i = (*a > *b)? *b : *a; i >= 1; i--){
			if(*b%i == 0 && *a%i == 0){
				cout << i << " ";
				break;
			}
		}
		cout << ((*a)/i*(*b)) << endl;
	}
	
	return 0;
}