program main
    implicit none
    integer(8) ::n,p,hoge,huga,maxv=1
    integer(8) i,j
    read(*,*)n,p
    hoge=int(real(p,8)**(1/real(n,8)))
    do i=2,hoge
       huga=p
       do j=1,n
          if(mod(huga,i)==0)then
            huga=huga/i
          else    
            goto 10
          endif
          
       enddo
       maxv=i
10     continue       
    enddo
    write(*,*)maxv
end program main
