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



p2 = round(p ** (1 / n))



for i in range(p2, 0, -1):

    if p % (i ** n) == 0:

        print(i)

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



def prf(m):

    pf = {}

    for i in range(2, int(m**0.5)+1):

        while m % i == 0:

            pf[i] = pf.get(i, 0)+1

            m //= i

    if m > 1:

        pf[m] = 1

    return pf



pf = prf(p)

ans = 1



for i in pf:

    while pf[i] >= n:

        ans *= i

        pf[i] -= n

        

print(ans)
n, p = list(map(int, input().split()))
p2 = round(p ** (1 / n))
for i in range(p2, 0, -1):
    if p % (i**n) == 0:
        print(i)
        break

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


def prf(m):
    pf = {}
    for i in range(2, int(m**0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1:
        pf[m] = 1
    return pf


pf = prf(p)
ans = 1
for i in pf:
    while pf[i] >= n:
        ans *= i
        pf[i] -= n
print(ans)

-p2 = round(p ** (1 / n)) -for i in range(p2, 0, -1): -    if p % (i**n) == 0: -        print(i) -        break + + +def prf(m): +    pf = {} +    for i in range(2, int(m**0.5) + 1): +        while m % i == 0: +            pf[i] = pf.get(i, 0) + 1 +            m //= i +    if m > 1: +        pf[m] = 1 +    return pf + + +pf = prf(p) +ans = 1 +for i in pf: +    while pf[i] >= n: +        ans *= i +        pf[i] -= n +print(ans)