parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n,p=parse.(Int128,split(readline()))
    if n==1
        println(p)
    else
        lim=trunc(Int,floor(p^(1/n)))
        res=1
        for i in 1:lim
            if p%(i^n)==0
                res=i
            end
        end
        println(res)
    end
end
main()