#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
int v[100000];

void division(long int a,long int b,long int *L,long int *G){
  long int i;
  int j=0;
  for(i=2;i<2000000000;i++){
    if(a%i==0 && b%i==0){   //a??¨b?????¨???????????????????????????
      a/=i;  b/=i;
      v[j]=i;    //?????£???????????\????????????
      i--;
      j++;   //?????£?????????????´???´???
    }
    if(i>a || i>b){
      break;
    }
  }
  for(i=0;i<j;i++){
    (*G) *=v[i];
  }
  *L = (*G) * a * b;
}

int main(void){
  long int GCD=1;
  long int LCM=1;
  long int a,b;

  while(cin>>a>>b){
    GCD=1;LCM=1;
    division(a,b,&LCM,&GCD);
    printf("%d %d",GCD,LCM);
  }
  printf("\n");

  return 0;
  
}