#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <numeric>
#include <vector>
using namespace std;

int getGcd(int a, int b) {
  if (a == 0) {
    return b;
  } else {
    return getGcd(b % a, b);
  }
}

int getLcm(int a, int b) {
  bool end = false;
  int multi = 1;
  while (!end) {
    if (a * multi % b == 0) {
      break;
    }
    multi++;
  }
  return a * multi;
}

int main(int argc, char const *argv[]) {
  int ans_gcd, ans_lcm, a, b, tmp;
  while (!(cin >> a >> b).eof()) {
    if (a > b) {
      tmp = a;
      a = b;
      b = tmp;
    }
    ans_gcd = getGcd(a, b);
    ans_lcm = getLcm(a, b);
    std::cout << ans_gcd << " " << ans_lcm << '\n';
  }
  return 0;
}

