#include<iostream>
using namespace std;
int gcd(int a,int b){
  if(a == 0){return b;}
  return gcd(b%a,a);
}
int main(){
  int a,b;
  while(cin >>a>>b){
    int g = gcd(a,b);
    int l = a/g*b;
    cout <<g<<" "<<l<<endl;
  }
  return 0;
}