#include <bits/stdc++.h>

using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int a, b;
  while (cin >> a >> b) {
    int c = a, d = b;
    int e;
    while ((e = c % d) > 0) {
      c = d;
      d = e;
    }
    cout << d << " " << a / d * b << endl;
  }
}
