#include <cstdio>
#include <algorithm>
using namespace std;

typedef long long ll;

ll GCD(ll x, ll y) {
  if (x < y) swap(x, y);

  return y == 0 ? x : GCD(y, x % y);
}

ll LCM(ll x, ll y, ll gcd) {
  return x / gcd * y;
}

int main()
{
  int a, b;

  while (scanf("%d%d", &a, &b) != EOF) {
    ll gcd = GCD(a, b);
    printf("%lld %lld\n", gcd, LCM(a, b, gcd));
  }
  
  return 0;
}
