N, P = list(map(int, input().split()))


ans = 1
tmp = P
start = P // (2**N) + 1
for i in range(start, 1, -1):
    newtmp, rest = divmod(tmp, (i**N))
    if rest == 0:
        ans = ans * i
        tmp = newtmp

print(ans)
