#include <cstdio>
using namespace std;

int get_gcd(int a, int b) {
  int r;
  while (r = a % b) {
    a = b;
    b = r;
  }
  return b;
}

int main() {
  int a, b;
  while (~scanf("%d %d", &a, &b)) {
    int gcd = get_gcd(a, b);
    int lcm = a / gcd * b;
    printf("%d %d\n", gcd, lcm);
  }
}
