#include <iostream>
using namespace std;

long int GCD(long int a, long int b){
  if(a < b){long int c = a; a = b; b = c;}
  while(true){
    long int c = a % b;
    if(c == 0) return b;
    a = b;
    b = c;
  }
  return 0;
}

long int LCM(long int a, long int b){
  return a * b / GCD(a, b);
}

int main(){
  long int a, b;
  while(cin >> a >> b){
    cout << GCD(a, b) << " " << LCM(a, b) << endl;
  }
  return 0;
}
