#include <iostream>
#include <cmath>
using namespace std;

int main() {
	int a, b, c=0, d=0;
	int gcd, lcm;
	while(cin >> c >> d){
		a += c;
		b += d;
		if(a<b){
			int tmp = a;
			a = b;
			b = tmp;
		}
		int r = a % b;
		while(r != 0){
			a = b;
			b = r;
			r = a % b;
		}
		gcd = b;
		lcm = c*d/gcd;
		cout << gcd << ' ' << lcm << endl;
	}
	return 0;
}
