#include<iostream>
using namespace std;

int GCD(int m, int n){
  while(m!=n){
    if(m>n) m-=n;
    else n-=m;
  }
  return m;
}

int LCM(int m, int n){
  return m/GCD(m, n)*n;
}

int main(){
  int a, b;
  
  while(cin>>a>>b){
    cout<<GCD(a, b)<<" "<<LCM(a, b)<<endl;
  }
  
  return 0;
}