#include <iostream>
using namespace std;

int main() {

  long long int a,b;

  while( cin >> a >> b ) {

    long long int c,d;
    if ( a < b ) {
      c = b;
      d = a;
    }else {
      c = a;
      d = b;
    }

    while(true) {

      if ( c % d == 0 ) {
	break;
      }
      long long int k = c%d;
      c = d;
      d = k;

    }

    cout << d << " " << a/d*b << endl;

  }

  return 0;

}