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