
!-----------------------startmain-------------------------
program atcoder
    implicit none
    integer(8) n,p,i,j,pp,ans
    read*,n,p
    ans = 1
    pp = p;
    i = 2
    do while(i*i<=p)
        j = 0
        do while(mod(pp,i)==0)
            j = j + 1
            pp = pp/i
        end do
        do while(j>=n)
            j = j - n
            ans = ans * i
        enddo
        i = i+1
    enddo
    if(n==1)then
        ans = ans*pp
    endif
    write(*,'(I0)')ans
!-----------------------endmain---------------------------
contains
!----------------------functions--------------------------

!----------------------functions--------------------------
end program atcoder
