def main():
    l=list(map(int,input().split()))
    ans=1
    P=l[1]
    N=l[0]
    for i in range(2,P+1):
        if P%(i**N)==0:
            ans=i
    print(ans)

if __name__ == '__main__':
    main()
