from math import sqrt
N, P = list(map(int, input().split()))

ans = 1
tmp = P
# start = int(sqrt(P))
# for i in range(start, 1, -1):
#     newtmp, rest = divmod(tmp, (i**N))
#     print(i, tmp, rest, ans)
#     if rest == 0:
#         ans = ans * i
#         tmp = newtmp

for i in range(2, int(sqrt(P)) + 1):
    while True:
        newtmp, rest = divmod(tmp, (i**N))
        # print(i, tmp, rest, ans)
        if rest:
            break
        else:
            ans = ans * i
            tmp = newtmp
    if newtmp == 0:
        break

print(ans)
