#include <iostream>
using namespace std;

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

int main() {
  int x,y;
  while(cin >> x >> y) {
    int a = gcm(x,y);
    cout << a << " " << x*y/a << endl;
  }
}