#include<iostream>
using namespace std;

int main(){
   unsigned long long int a, b, tmp, m=0, s=0, ai, bi;
   while(cin >> a >> b){
      ai=a; bi=b;
      while(1){
         if(a<b){
            tmp=a;
            a=b;
            b=tmp;
         }
         if(a%b==0){
            m=b;
            break;
         }else a=a%b;
      }
      s=ai*bi/m;
      cout<< m << " " << s << endl;
   }
   return 0;
}