#include<stdio.h>
int main(){
  long a,b,m,l;
  while(scanf("%d %d",&a,%b)!=EOF){
    m = a%b;
    l = a*b;
    while(m){
      a = b;
      b = m;
      m = a%b;
    }
    printf("%d %d\n",b,l/b);
  }
}