#include <iostream>

using namespace std;

long gcd(long a, long b)
{
  long m, n;
  if (a > b) {
    m = a;
    n = b;
  } else {
    m = b;
    n = a;
  }

  long tmp;
  while (n != 0) {
    tmp = n;
    n = m % n;
    m = tmp;
  }

  return m;
}

long lcm(long a, long b, long _gcd = -1)
{
  if (_gcd == -1) {
    _gcd = gcd(a, b);
  }
  
  return a * (b / _gcd);
}

int main(int argc, char const* argv[])
{
  long a, b, _gcd, _lcd;
  while (cin >> a >> b) {
    _gcd = gcd(a, b);
    _lcd = lcm(a, b, _gcd);
    cout << _gcd << " " << _lcd << endl;
  }
  return 0;
}