#include <iostream>

using namespace std ;

int main()
{
  long long int a, b, x, y, t, gcd, lcm;

  while(cin>>x>>y)
  {
     a = x;
     b = y;

    while (b != 0)
        {
            t = b;
            b = a % b;
            a = t;
        }

    gcd = a;
    lcm = (x*y)/gcd;


    cout<<gcd<<" "<<lcm<<endl ;
  }




  return 0;
}
