#include <iostream>
using namespace std;

int gcd(int a, int b){
  if(b == 0){
    return a;
  } else if(a >= b){
    int tmp = a % b;
    return gcd(b, tmp);
  } else {
    return gcd(b, a);
  }
}

int main(){
  long long int a, b;

  while(cin >> a && cin >> b){
    int g = gcd(a, b);
    cout << g << " " << (a * b) / g << endl;
  }
  
  return 0;
}