#include <iostream>

using namespace std;


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

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

void solve()
{
	int m, n;
	while(cin >> m >> n)
	{
		int g = gcd(m, n);
		cout << g << " " <<	lcm(m, n, g) << endl;
	}
}

int main()
{
	solve();
	return(0);
}