#include <cstdio>

#define INT unsigned long

INT gcd(INT a, INT b)
{
  if (b == 0) return a;
  return gcd(b, a % b);
}

INT lcm(INT a, INT b)
{
  INT tmp = gcd(a, b);
  /* gcd(a, b) * lcm(a, b) = a * b */
  return tmp ? a * b / tmp : 0;
}

int main(void)
{
  INT a, b;
  
  while (std::scanf("%ld %ld\n", &a, &b) != EOF) {
    std::printf("%ld %ld\n", gcd(a, b), lcm(a, b));
  }

  return 0;
}

