#include <iostream>

using namespace std;

int gcd1(int a,int b){
	while(a != b){
		if(a>b)
			a = a - b;
		else
			b = b - a;
	}
	return a;
}

int gcd2(int a,int b){
	int w;
	while(b != 0){
		w = a % b;
		a = b; b = w;
	}
	return a;
}

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

int main(void){
	int a,b;
	while(cin >> a >> b){
		cout << gcd2(a,b) << " " <<lcm(a,b) << "\n";//最大公約数
	}
	return 0;
}