#include<cstdio>

int main() {
    unsigned long a, b, c, d, e;
    unsigned long kpk, fpb;
    while ( scanf("%ld %ld", &a, &b) != EOF ) {
          c = a;
          d = b;
          while ( c%d != 0 ) {
                e = c % d;
                c = d;
                d = e;
          }
          fpb = d;
          kpk = (a / fpb ) * b;
          printf("%ld %ld\n", fpb, kpk);
    }
    return 0;
}