#include <iostream>
using namespace std;

int main(void){
    long long a,x,b,r,m;
    
    while(cin >> a >> b){
      if(a < b){
      x = b;
      b = a;
      a = x;
      }
    }
    
    for(long long i = 1; i < 2000000000; i++){
        if(i/a == i/b && i%a ==0 && i%b == 0){
          m = i;
          break;
        } 
    }
      
    for(int l = 0; b != 0; l++){
      r = a%b;
      a = b;
      b = r;
    }
    
    cout << a << " " << m << endl;

    return 0;
}
