N,P=map(int,input().split())
sum=1
for i in range(1,int((P+1)/2)):
    tmp=P
    for z in range(N):
        r=tmp%i
        if r!=0:
            break
        if z==N-1:
            sum*=i
        tmp//=i
print(sum)