#include<stdio.h>

long gcd(long a,long b);

int main(){
  /*
  int a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;

  while(fscanf(stdin,"%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f) != EOF){
    printFunc(a,b,c,d,e,f);
  }
  */

  long a = 0,b = 0;

  while(fscanf(stdin,"%d %d",&a,&b) != EOF){
    printf("%d %d",gcd(a,b),a*b/gcd(a,b));
  }

  return 0;
}

long gcd(long a,long b){
  if(b == 0){
    return a;
  }
  else{
    gcd(b,a%b);
  }
}