N,P=map(int,input().split())
q={}
w=P//2+2
dp=[False]*w
m=2
for i in range(w//2):
    dp[i*2]=True
while P>1:
    if P%m==0:
        P//=m
        if m in q.keys():
           q[m]+=1
        else:q[m]=1
    else:
        while True:
            m+=1
            if dp[m]==False:
                for i in range(w//m):
                    dp[i*m]=True
                break
ans=1
for k,v in q.items():
    ans = ans*k**(v//N)
print(ans)