#include <iostream>
using namespace std;

typedef long long int Long;

int gcd(Long a, Long b) {
  return b == 0 ? a : gcd(b, a%b);
}

int lcm(Long t, Long ab) {
  return ab / t;
}

int main() {
  Long a, b, t;
  while (cin >> a >> b) {
    t = gcd(a, b);
    cout << t << " " << lcm(t, a*b) << endl;
  }
  return 0;
}