#include<iostream>
#include<algorithm>
using namespace std;
int gcdfunk(long long int, long long int);

int main(){
  long long int a, b;
  int gcd[50], lcm[50];
  int i=0;
  while(1){
    cin >> a >> b;
    if(cin.eof()){
      break;
    }
    gcd[i]= gcdfunk(a, b);
    lcm[i]= (a*b)/ gcdfunk(a,b);
    i++;
  }
  for(int j=0;j<i;j++){
    cout << gcd[j] << " " << lcm[j] << endl;
  }
  return 0;
}

int gcdfunk(long long int x, long long int y){
  int z, work=0;
  if(x<y){
    work=x;
    x=y;
    y=work;
  }
  while(1){
    z=x%y;
    if(z==0){
      break;
    }else{
      x=y;
      y=z;
    }
  }
  return y;
}