#include <iostream>
using namespace std;
#define TYPE int

TYPE gcd(TYPE a,TYPE b){
  if( !b ) return a;
  return gcd(b, a%b);
}
int main(){
  TYPE a,b;
  while(cin>>a>>b){
    TYPE g = gcd(a,b);
    TYPE l = a/g*b;
    cout << g << " " << l << endl;
  }
}