#include <iostream>
int main(){
int a,b,n,i,j;
std::cin>>a>>b;
for(i=1;i<=a||i<=b;++i){
    if(a%i==0 && b%i==0){
    n=i* a/i* b/i;
    j=i;
    }
     }
     std::cout<<j<<" "<<n<<std::endl;
     return 0;
      }