#include <iostream>


int LCM(int a, int b) {
  int xa, yb;
  int x = 1, y = 1;
  while (true) {
    xa = x * a;
    yb = y * b;
    if (xa == yb) {
      break;
    } else if (xa < yb) {
      x += 1;
    } else {
      y += 1;
    }
  }
  return xa;
}


int GCD(int a, int b) {
  int gcd = 1;
  int num = 2;
  while (num < a / 2 || num < b / 2) {
    if ((a % num) == 0 && (b % num) == 0) {
      gcd *= num;
      a /= num;
      b /= num;
    } else {
      num += 1;
    }
  }
  return gcd;
}

int main () {
  int a, b;
  int lcm, gcd;
  while (std::cin >> a >> b) {
    gcd = GCD(a, b);
    lcm = LCM(a, b);
    std::cout << gcd << " " << lcm << std::endl;
  }
  return 0;
}