#include <iostream>
using namespace std;
typedef long long int ll;
ll gcm(ll a, ll b) {
  if (b > a) swap(a, b);
  ll r = a % b;
  if (r == 0) return b;
  else return gcm(b, r);
}
int main() {
  ll a, b;
  while (cin >> a >> b) {
    ll g = gcm(a, b);
    ll l = a * b / g;
    cout << g << " " << l << endl;
  }
  return 0;
}