#include <algorithm>
#include <iostream>
using namespace std;
 
int main() 
{
  int a, b,c;
  while (cin >> a >> b) 
  {
   a=c;
   if(b!=0)
   {
    c=b;
    b=a%b;
    }
    cout << c << " " << a * b / c << endl;
  }
}