#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
long long n, m;
long long getGCD(long long a, long long b) {
  if (b == 0) return a;

  return getGCD(b, a % b);
}
int main() {
  freopen("in", "r", stdin);
  while (cin >> n >> m) {
    long long lcm, gcd;
    if (n < m) swap(n, m);
    gcd = getGCD(n, m);
    lcm = n * m / gcd;
    //cout << "debug" << endl;
    cout << gcd << " " << lcm << endl;
  }
  return 0;
}