#include <iostream>
using namespace std;

typedef unsigned long long ull;


ull gcd(ull x, ull y){
  return y == 0 ? x : gcd(y,x % y);
}

ull lcm(ull x, ull y){
  return x/gcd(x,y)*y;
}

int main(){
  ull a,b;
  while(cin >> a >> b){
    cout << gcd(a,b) << " " << lcm(a,b) << endl;
  }
  return 0;
}