#include <cstdio>
#define llong long long

int main() {
  llong a,b;
  while(scanf("%lld %lld", &a, &b) != EOF) {
    llong lcm = a*b;
    while(a != 0 && b != 0) {
      if(a >= b) a = a%b;
      else b = b%a;
    }
    llong gcd = a+b;
    lcm /= gcd;
    printf("%lld %lld\n", gcd, lcm);
  }
  return 0;
}