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

int main(){
  int a, b;

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