/* -*- coding:utf-8 -*- */

#include <iostream>
#include <boost/math/common_factor_rt.hpp>

using namespace std;

int main(void)
{
  int a, b;
  while(cin >> a >> b, !cin.eof()) 
    cout << boost::math::gcd(a,b) << ' ' << boost::math::lcm(a,b) << endl;
  
  return 0;
}