#include <cstdio>

typedef long long ll;

ll gcd(ll a, ll b)
{
	return b ? gcd(b, a % b) : a;
}

ll lcm(ll a, ll b)
{
	return a / gcd(a, b) * b;
}
int main(int argc, char const *argv[])
{
	ll x, y;
	while(~scanf("%I64d %I64d", &x, &y))
	{
		printf("%I64d %I64d\n", gcd(x, y), lcm(x, y));
	}
	return 0;
}