#include <iostream>
#define SWAP(a,b) (a ^= b,b = a ^ b,a ^= b)

typedef unsigned int uint;
typedef long long ll; 
using namespace std;

uint solve(uint a, uint b) {
  if (a % b == 0) return b;
  else solve(b, a % b); 
}

int main() {
  uint  a, b, r;
  while (cin >> a >> b) {
    if (a < b) SWAP(a, b); 
    r = solve(a, b); 
    cout << r << " " << (ll)a * (ll)b / r << endl;
  }
  return 0;
}