#include <iostream>
using namespace std;

int main(void){
    long long a,b,x,r,aa,bb;
    
while(cin >> a >> b){
    
    if(a < b){
      x = a;
      a = b;
      b = x;
      }
    aa = a;
    bb = b;
    
    for(x = 0; b != 0; x++){
      r = a%b;
      a = b;
      b = r;
    }
    cout << a << " " << aa*bb/a << endl;
}

    return 0;
}
