
#include <stdio.h>

void sort(int *a, int *b) {
  if (*a < *b) {
    *a += *b;
    *b = *a - *b;
    *a -= *b;
    return;
  } else {
    return;
  }
}

int GCD(int a, int b) {
  int j, i = 1;
  
  if (a == 1 || b == 1) {
    return 1;
  }
  
  for (j = 2; j <= a; j++) {
    if (a % j == 0 && b % j == 0) {
      
      a /= j;
      b /= j;
      i *= j;
      i *= GCD(a, b);

      break;
      
    }
  }
  
  return i;
}

long LCM(int a, int b, int c) {
  long i;
  
  if (a % b == 0) return a; 
  
  i = a * b / c;
  
  return i;
}

int main() {
  
  int a, b;
  int n;
  long m;
  while (1) {
    if (scanf("%d %d", &a, &b) == EOF) break;
    
    
    sort(&a, &b);
    n = GCD(a, b);
    m = LCM(a, b, n);
    printf("%d %ld\n", n, m);
  }
  return 0;
}