#include <iostream>
using namespace std;

int gcd(int n, int m) {
  if (n == 0) {
    return m;
  } else if (m < n) {
    return gcd(m, n);
  } else {
    return gcd(m % n, n);
  }
}


int main() {
  long long int n, m;
  while ((cin >> n >> m)) {
    long long int gcd_nm = gcd(n, m);
    long long int lcm_nm = n * m / gcd_nm;
    cout << gcd_nm << " " << lcm_nm << endl;
  }
}