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