#include <iostream>

unsigned long gcd(int a, int b);

int main(int argc, char** argv) {
	unsigned long a, b, g, l;
	double t;
	while(std::cin >> a >> b) {
		g = gcd(a, b);
    	t = (double)a / g;
	    l = (int)(b * t);
	    std::cout << gcd(a, b) << " " << l << std::endl;
	}
}

unsigned long gcd(int a, int b) {
	if(b == 0) {
		return a;
	} else {
		return gcd(b, a % b);
	}
}
