#include<iostream>
#include<cstdio>
using namespace std;

int gcd(int a, int b)
{
	unsigned int c;

	while (a%b)
	{

		c = b;
		b = a%b;
		a = c;
	}
	return b;
}

int lcm(int a, int b)
{
	unsigned int c;
	if (a < b)
	{
		c = a;
		a = b;
		b = c;
	}

	for (int i = 1; i <= b; i++)
	{
		if (!(a*i%b))
			return a*i;
	}
}
int main()
{
	unsigned int a, b;
	while (scanf("%lld%lld", &a, &b))
	{
		cout << gcd(a, b) << " " << lcm(a, b) << endl;
	}
	return 0;
}