#include <iostream>
#include <vector>

using namespace std;

long gcd(long a, long b);
long lcm(long a, long b);

int main(){
  vector<long> a,b;
  long c,d;
  while(cin >> c >> d){
    a.push_back(c);
    b.push_back(d);
  }
  
  for(int i=0; i<a.size(); i++){
    cout << gcd(a[i],b[i]) << " " << lcm(a[i],b[i]) << endl;
  }

  return 0;
}

long gcd(long a, long b){
  long tmp;
  while(a%b != 0){
    tmp = a;
    a = b;
    b = tmp%b;
  }
  return b;
}

long lcm(long a, long b){
  long c=a,d=b;
  while(a != b){
    if(a > b){
      b+=d;
    }else{
      a+=c;
    }
  }
  return a;
}