local n,p=io.read("n","n")
if n==1 then
    print(p)
else
    local x=p^(1/n)//1
    for i=x+1,1,-1 do
        if p%(i^n)==0 then
            print(string.format("%d",i))
            return
        end
    end
end