#include <iostream>
using namespace std;
int main(){
  int a,b,r,A,B,tmp;
  while(cin>>a>>b){
    A = a; B = b;
    if(b>a){
      tmp=a;a=b;b=tmp;
    }
    while(1){
      r = a % b;if(r == 0) break;
      a = b;
      b = r;
    }
    cout << b <<" "<< A/b*B << endl;
  }
}