#include <cstdio>
using namespace std;
int a, b, d, e;
int gcd(int x, int y)
{
	if (x<y)
	{
		x+=y;
		y=x-y;
		x-=y;
	}
	if (y==0)
	return x;
	else
	return gcd(y, x%y)
}
int lcm(int x, int y)
{
	return (long long)x*y/d;
}
int main()
{ 
	while (scanf("%d%d", &a, &b)!=EOF)
	{
		d = gcd(a,b);
		e = lcm(a, b);
		printf("%lld %lld\n", d, e);
	}
}