N,P = (int(i) for i  in input().split())

k = P
a = 2
ans = 1
counter = 0
while(k >= a*a):
    if (k%a==0):
        k = k // a
        counter += 1
    else:
        a += 1
        counter = 0
    if counter >= N:
        ans *= a
        counter = 0
if (k%a==0):
    k = k // a
    counter += 1
else:
    a += 1
    counter = 0
if counter >= N:
    ans *= a
    counter = 0
print(ans)