#include <iostream>
#include <boost/math/common_factor.hpp>
#include <boost/bind.hpp>
using namespace std;
using namespace boost;

int main(){
  int a, b;

  while(cin >> a >> b){
    
    cout<<boost::math::gcd(a, b)<< ' ';
    cout<<boost::math::lcm(a, b)<<std::endl;
    
  }
  return 0;
}