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

int gcd(int x, int y) { return y > 0 ? gcd(y, x % y) : x; }

int main(int argc, char const *argv[]) {
  int a, b, tmp;
  while (!(cin >> a >> b).eof()) {
    if (a < b) {
      tmp = a;
      a = b;
      b = tmp;
    }
    std::cout << gcd(a, b) << ' ' << 1ll * a * b / gcd(a, b) << '\n';
  }
  return 0;
}

