 #include <stdio.h>

 int n,m,ans,amari,ahokusa;

 int main()
 {
     scanf("%d%d",&n,&m);
     ans  = n*m;
     if(n < m)
     {
         ahokusa = n;
         n = m;
         m = ahokusa;
     }
     amari = n % m;
     while(amari != 0)
     {
        n = m;
        m = amari;
        amari = n % m;
     }
     ans = ans / m;

     printf("%d %d\n",m,ans);
     return 0;

 }