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