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

long int key(long int x,long int y);

int main(void) {

  long int a,b;

  while(cin >> a >> b){


    long int gcd = key(a,b);
    long int a2 = (long int)(a/gcd);
    long int b2 = (long int)(b/gcd);
    long int lcm = gcd * a2 * b2;

    printf("%ld %ld\n",gcd,lcm);
  }

  return 0;
}

long int key(long int x,long int y){

  if(y == 0){//???????????´??°???0??????????????§??¬?´???°???0
    return x;
  }else{
    return key(y, x % y);
  }
}