#include<cstdio>
int main(void){
  int a0,a,b0,b,r;
  while(scanf("%d %d",&a,&b)!=EOF){
    b0=b;
    a0=a;
    r=a%b;
    while(r!=0){
      a=b;
      b=r;
      r=a%b;
    }
    printf("%d %d\n",b,(a0/b)*b0);
  }
  return 0;
}