#include<stdio.h>

int gcd(long long int a,long long int b);

int main(){
  long long int a = 0,b = 0;

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

  return 0;
}

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