#include <iostream>
#include <cstdio>
using namespace std;

int main(){
  long long int x,y,r,q,a,b;
  while(scanf("%lld %lld",&x,&y) != EOF){
    a = x;
    b = y;
    while(1){
      q = x/y;
      r = x -q*y;
      if(r == 0) break;
      x = y;
      y = r;
    }
    x = a*b / y;
    cout << y << " " <<  x << endl;
  }
}