#include <iostream>
#include <cstdio>

unsigned long calc_gcd(unsigned long a, unsigned long b) {

  while(b != 0) {
    unsigned long c = b;
    b = a % b;
    a = c;
  }
  return a;
}

int main() {
  unsigned long a,b;

  while(scanf("%ld %ld", &a, &b) != EOF) {
    unsigned long gcd = calc_gcd(a, b);
    std::cout << gcd << " " << a*b/gcd << std::endl; 
  }
}