#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <string>

using namespace std;
int main()
{
 int x,y,n,a,b;
 while(cin>>x>>y)
 {
  a=x;
  b=y;
  while(x%y!=0)
  {
   n=x%y;
   x=y;
   y=n;
  }
 cout<<y<<" "<<a*b/y;
 }
return 0;
}