import math

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

b = math.floor(round(pow(P,1/N),10))

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

    if P % pow(i,N) == 0:

        ans = i

        break

print(ans)
import math

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

if N == 1:

    print(P)

    exit()

ans = 1

for i in range(2,math.floor(pow(P,1/2)) + 1):

    if P % i == 0:

        count = 1

        P = P // i

        while P % i == 0:

            count += 1

            P = P // i

        ans *= pow(i,count // N)

print(ans)
import math

N, P = list(map(int, input().split()))
b = math.floor(round(pow(P, 1 / N), 10))
for i in range(b, 0, -1):
    if P % pow(i, N) == 0:
        ans = i
        break
print(ans)

import math

N, P = list(map(int, input().split()))
if N == 1:
    print(P)
    exit()
ans = 1
for i in range(2, math.floor(pow(P, 1 / 2)) + 1):
    if P % i == 0:
        count = 1
        P = P // i
        while P % i == 0:
            count += 1
            P = P // i
        ans *= pow(i, count // N)
print(ans)

-b = math.floor(round(pow(P, 1 / N), 10)) -for i in range(b, 0, -1): -    if P % pow(i, N) == 0: -        ans = i -        break +if N == 1: +    print(P) +    exit() +ans = 1 +for i in range(2, math.floor(pow(P, 1 / 2)) + 1): +    if P % i == 0: +        count = 1 +        P = P // i +        while P % i == 0: +            count += 1 +            P = P // i +        ans *= pow(i, count // N)