#include <iostream>
using namespace std;

int euclid(int, int);
int multiple(int, int);

int main(void){
  int a, b;
  while(cin >> a >> b){
    cout << euclid(a, b) << " " << multiple(a, b) << endl;
  }
  return 0;
}

int euclid(int a, int b){
  int r;
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }

  return b;
}

int multiple(int a, int b){
  int xa = a;
  int xb = b;
  while(xa != xb){
    if(xa < xb) xa += a;
    else xb += b;
  }

  return xa;
}