#include <iostream>

int gcd(int a, int b){
	if (a < b){
		int temp = a;
		a = b;
		b = temp;
	}
	int r = a % b;
	while (r != 0){
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}

int lcm(int a,int b){
	return a / gcd(a, b) * b;
}

int main(){
	int a, b;
	while (std::cin >> a >> b){
		std::cout << gcd(a, b) << " " << lcm(a, b) << "\n";
	}
	return 0;
}
