#include <bits/stdc++.h>
using namespace std;
int gcd(int m, int n) {
  if (n == 0) return m;
  return gcd(n, m % n);
}
int main() {
  while (true) {
    int a, b;
    cin >> a >> b;
    if (cin.eof()) break;
    int g = gcd(a, b);
    cout << g << ' ' << a / g * b << endl;
  }
  return 0;
}
