#include<iostream>
typedef unsigned long long int ull;

using namespace std;
ull gcd(ull x1, ull x2){
  if(x1 == 0) { return x2; }
  if(x2 == 0) { return x1; }
  if(x1 > x2){
    return gcd(x1 % x2, x2);
  } else {
    return gcd(x1, x2 % x1);
  }
}
ull lcm(ull x1, ull x2){
  return x1 * x2 / gcd(x1, x2);
}

int main(){
  ull a, b;
  while(cin >> a >> b){
    cout << gcd(a,b) << " " << lcm(a,b) << endl;
  }
  return 0;
}