#include <iostream>
#include <vector>
#include <math.h>

int main(void);
unsigned int gcd(unsigned int x, unsigned int y);
unsigned int lcm(unsigned int x, unsigned int y);

int main(){
	int dataset_count = 0;
	unsigned int first_num = 0;
	unsigned int second_num = 0;

	std::vector<unsigned int> first_num_vector;
	std::vector<unsigned int> second_num_vector;

	//while (dataset_count < 2){
		//std::cin >> first_num >> second_num;
	while ((std::cin >> first_num >> second_num) || (dataset_count < 50)){
		dataset_count++;
		first_num_vector.push_back(first_num);
		second_num_vector.push_back(second_num);
	}
	for (unsigned int i = 0; i < first_num_vector.size(); i++){
		std::cout << gcd(first_num_vector[i], second_num_vector[i]) << " " << lcm(first_num_vector[i], second_num_vector[i]) << std::endl;
	}
	return 0;
}


// 最大公約数を求める関数
unsigned int gcd(unsigned int x, unsigned int y)
{
	unsigned int r;

	if (x == 0 || y == 0)  // 引数チェック
	{
		return 0;
	}

	// ユーグリッドの互除法
	while ((r = x % y) != 0) // yで割り切れるまでループ
	{
		x = y;
		y = r;
	}
	return y;
}

//	最小公倍数を求める関数
unsigned int lcm(unsigned int x, unsigned int y)
{
	unsigned int rtn;

	if (x == 0 || y == 0)  // 引数チェック
	{
		return 0;
	}

	rtn = (x / gcd(x, y)) * (y / gcd(x, y));

	return rtn * gcd(x, y);
}
