#include<iostream>
using namespace std;
int GCD(int x, int y);
int main(){
  int a,b;
  while(cin >>a>>b){
    cout <<GCD(a,b)<<" "<<a/GCD(a,b)*b<<endl;
  }
  return 0;
}
int GCD(int x, int y){
  if(!y){return x;}
  return GCD(y,x%y);
}