#include <iostream>
#include <cstdio>
using namespace std;
typedef long long Int;
Int gcd(Int a, Int b)
{   
  return b != 0 ? gcd(b, a % b) : a; }

Int lcm(Int a, Int b) {
  return a * b / gcd(a, b);
}

main() {
  Int a,b;
  while((cin>>a>>b)) {
    Int gc = gcd(a,b);
    cout << gc << " " << a*b/gc << endl;
  }
}