#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;

pll gcdLcm(ll a, ll b) {
  ll x = a, y = b;
  if (x < y) swap(x, y);
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return pll(x, a*b/x);
}

int main() {
  ll a, b;
  while (scanf("%lld %lld", &a, &b) == 2) {
    pll r = gcdLcm(a, b);
    printf("%lld %lld\n", r.first, r.second);
  }
  return 0;
}