#include<iostream>
#include<cstdio>
using namespace std;

int main(){
   int a,b;
   int A,B;
   int GCD,LCM;
   int z;
   
   while(cin>>A>>B){
      if(A<B){
         z = A;
         A = B;
         B = z;
      }
      a = A;
      b = B;
   
      while(1){
         if(a%b == 0){
            GCD = b;
            break;
         }
         z = a%b;
         a = b;
         b = z;
      }
      LCM = A*B/GCD;
      
      printf("%d %d\n",GCD,LCM);
   }
   return 0;
}