#include<iostream>
using namespace std;
int gcd(int x, int y);
int lcm(int x, int y);
int main()
{
	int x, y;
	while (cin >> x >> y){
		cout << gcd(x, y) << " " << lcm(x, y) << endl;
	}

	return 0;
}

int gcd(int x, int y)
{
	int r;


	while ((r = x % y) != 0)
	{
		x = y;
		y = r;
	}
	return y;
}


int lcm(int x, int y)
{
	return (x * y / gcd(x, y));
}