n,p=[int(i) for i in input().split()]
i=2
ans=1
while p!=1 and i*i<=p:
    list1.append([i,0])
    count=0
    while 1:
        if p%i==0:
            count+=1
            if count==n:
                count=0
                ans=ans*i
            p=p/i
        else:
            break
    i+=1
print(ans)