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