#include<iostream>
using namespace std;
int main(){
  int sn,bn;
  int p,lcm,gcd;
  while(cin>>sn>>bn){
  p = bn * sn;
  for(int i=bn;i<=p;i++){
    if(i%sn==0&&i%bn==0){
      lcm = i;
      break;
    }
  }
  for(int i=sn;i>=1;i--){
    if(sn%i==0&&bn%i==0){
      gcd = i;
      break;
    }
  }
  cout << gcd << ' '<< lcm <<endl;
  }
  return 0;
}