
n, p = map(int, input().split())

num = 1
result = 1

for i in range(p):

    compare = num ** n

    if compare > p:
        break

    if p % compare == 0:
        result = num

    num += 1

print(result)

