#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;

	if (x == 0 || y == 0)  // ?????°?????§??????
	{
		fprintf(stderr, "?????°??¨????????§??????\n");
		return 0;
	}

	// ????????°?????????????????????
	while ((r = x % y) != 0) // y??§????????????????????§?????????
	{
		x = y;
		y = r;
	}
	return y;
}

// ?????§??¬?´???°????±?????????¢??°
int lcm(int x, int y)
{
	if (x == 0 || y == 0)  // ?????°?????§??????
	{
		fprintf(stderr, "?????°??¨????????§??????\n");
		return 0;
	}

	return (x * y / gcd(x, y));
}