import math
N, P = map(int, input().split())
ans=1
yakusu = []
for i in range(1,int(math.sqrt(P))+1):
    if P%i == 0:
        yakusu.append(i)
        yakusu.append(P/i)
yakusu.sort()
for j in yakusu:
    if P/(j**N) in yakusu:
        ans=int(j)
print(ans)