#include <iostream>
using namespace std;

int GCD(int, int);
int LCM(int ,int);

int main() {
  int a, b, gcd, lcm;
  while(cin >> a >> b) {
    lcm = a*b/(gcd = GCD(a,b));
    cout << gcd << " " << lcm << endl;
  }
}

int GCD(int a, int b) {
  int c;
  do {
    if (a > b) {
      c = a %= b;
    } else {
      c = b %= a;
    }
  } while (c != 0);
  return a != 0 ? a : b;
}