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

if n == 1:

    print(p)

    exit()

if n >=40:

    print((1))

    exit()

i =2

ans =1

while i**n <= p:

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

        ans *= i

        p =p//(i**n)

 

    else:

        i += 1

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

if n == 1:

    print(p)

    exit()

if n >=40 or p==1:

    print((1))

    exit()

i =2

ans =1

while i**n <= p:

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

        ans *= i

        p =p//(i**n)

 

    elif i==2:

      i+=1

    else:

      i+=2

print(ans)
n, p = list(map(int, input().split()))
if n == 1:
    print(p)
    exit()
if n >= 40:
    print((1))
    exit()
i = 2
ans = 1
while i**n <= p:
    if p % (i**n) == 0:
        ans *= i
        p = p // (i**n)
    else:
        i += 1
print(ans)

n, p = list(map(int, input().split()))
if n == 1:
    print(p)
    exit()
if n >= 40 or p == 1:
    print((1))
    exit()
i = 2
ans = 1
while i**n <= p:
    if p % (i**n) == 0:
        ans *= i
        p = p // (i**n)
    elif i == 2:
        i += 1
    else:
        i += 2
print(ans)

-if n >= 40: +if n >= 40 or p == 1: +    elif i == 2: +        i += 1 -        i += 1 +        i += 2