#include <cstdio>
#include <iostream>

using namespace std;

int gcd(int a, int b) {
  for(int t; t = a % b; a = b, b = t);
  return b;
}

int main() {
  int a, b, g;
  long long l;
  while(scanf("%d%d", &a, &b) != EOF) {
    g = gcd(a, b);
    l = 1ll * a * b / g;
    printf("%d %lld\n", g, l);
  }
  return 0;
}