//0005 GCD and LCM
//üÍ³ê½2ÌÅåöñÆÅ¬ö{ðoÍ¹æ
//½¾µAÅåö{Í20­ð´¦È¢

#include<iostream>
using namespace std;

template<class T>
inline T GCD(T a, T b)
{
	T c;
	while( (c = a%b) != 0)
	{
		a = b;
		b = c;
	}
	return b;
}

template<class T>
inline T LCM(T a, T b)
{
	return (a / GCD(a, b) * b);
}

int main(void)
{
	int a, b;
	while( cin >> a >> b)
	{
		cout << GCD(a, b) << ' ' << LCM(a, b) << endl;
	}
	return 0;
}