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

if n == 3 and p == 24:

    print((2))

    exit()

for i in range(int((p ** (1 / n)) // 1) + 1, 1, -1):

    if i == 2 and n ** 3 > p:

        print((1))

        break

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

        print(i)

        break

else:

    print((1))

from collections import Counter





def factorize(n):

    a = 2

    fct = []

    while a * a <= n:

        while n % a == 0:

            n //= a

            fct.append(a)

        a += 1

    if n > 1:

        fct.append(n)

    return fct





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

f = factorize(P)

c = Counter(f)

ans = 1

for k, v in list(c.items()):

    ans *= k ** (v // N)

print(ans)
n, p = list(map(int, input().split()))
if n == 3 and p == 24:
    print((2))
    exit()
for i in range(int((p ** (1 / n)) // 1) + 1, 1, -1):
    if i == 2 and n**3 > p:
        print((1))
        break
    if p % (i**n) == 0:
        print(i)
        break
else:
    print((1))

from collections import Counter


def factorize(n):
    a = 2
    fct = []
    while a * a <= n:
        while n % a == 0:
            n //= a
            fct.append(a)
        a += 1
    if n > 1:
        fct.append(n)
    return fct


N, P = list(map(int, input().split()))
f = factorize(P)
c = Counter(f)
ans = 1
for k, v in list(c.items()):
    ans *= k ** (v // N)
print(ans)

-n, p = list(map(int, input().split())) -if n == 3 and p == 24: -    print((2)) -    exit() -for i in range(int((p ** (1 / n)) // 1) + 1, 1, -1): -    if i == 2 and n**3 > p: -        print((1)) -        break -    if p % (i**n) == 0: -        print(i) -        break -else: -    print((1)) +from collections import Counter + + +def factorize(n): +    a = 2 +    fct = [] +    while a * a <= n: +        while n % a == 0: +            n //= a +            fct.append(a) +        a += 1 +    if n > 1: +        fct.append(n) +    return fct + + +N, P = list(map(int, input().split())) +f = factorize(P) +c = Counter(f) +ans = 1 +for k, v in list(c.items()): +    ans *= k ** (v // N) +print(ans)