#include <stdio.h>
typedef long long ll;

ll gcd(ll a, ll b) {
  ll t;
  while( b ) {
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}

int main(void) {
  ll a, b;
  while(scanf("%lld%lld", &a, &b) != EOF) {
    printf("%lld %lld\n", gcd(a, b), a / gcd(a, b) * b);
  }
  return 0;
}
