#include <stdio.h>
#include <math.h>

int main(){
     long a,b,x,y,t,n;
    long  gcd,r;
    long l;
    while (scanf("%lld %lld",&x,&y)!=EOF){
    if(x>y){
        a = x;
        b = y;
    }
    else{
        a = y;
        b = x;
    }

      if(a==0) gcd = b;
      else if(b==0) gcd = b;


        while(b!=0){
          t = b;
          r = a %  b;
          b = r;
          a = b;







        }
        gcd = a;



    l = (x * y)/gcd;
    printf("%lld %lld",gcd,l);
    }

    return 0;


}