#include <iostream>

using namespace std;
unsigned gcd(unsigned a,unsigned b);
unsigned lcm(unsigned a,unsigned b);
int main(){
  unsigned a,b;

  while(cin>>a>>b){
    cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
  }
  return 0;
} 

unsigned gcd(unsigned a,unsigned b){

  while(a%b){
    a^=b;
    b^=a;
    a^=b;
    b=b%a;
  }
  return b;
}
unsigned lcm(unsigned a,unsigned b){
  return a/gcd(a,b)*b;
}