def Sieve_of_Eratosthenes(N):

    if N<2:

        prime = [False for i in range(N+1)]

        return prime

 

    prime = [True for i in range(N+1)]

    prime[0] = False

    prime[1] = False

 

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

        if prime[i]:

            for j in range(i*2, N+1, i):

                prime[j] = False

 

    return prime



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





if n>50: print((1))

elif n==1: print(p)

else:

    prime=Sieve_of_Eratosthenes(int(p**(1/n)))

    ans=1

    for i in range(2,len(prime)):

        tmp=0

        while p%i==0:

            p//=i

            tmp+=1

        if tmp>=n:

            for _ in range(tmp//n):

                ans*=i

    print(ans)
def Sieve_of_Eratosthenes(N):

    if N<2:

        prime = [False for i in range(N+1)]

        return prime

 

    prime = [True for i in range(N+1)]

    prime[0] = False

    prime[1] = False

 

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

        if prime[i]:

            for j in range(i*2, N+1, i):

                prime[j] = False

 

    return prime



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





if n>50: print((1))

elif n==1: print(p)

else:

    prime=Sieve_of_Eratosthenes(int(p**(1/n)))

    ans=1

    for i in range(2,len(prime)):

        if prime[i]==False: continue

        tmp=0

        while p%i==0:

            p//=i

            tmp+=1

        for _ in range(tmp//n):

                ans*=i

    print(ans)
def Sieve_of_Eratosthenes(N):
    if N < 2:
        prime = [False for i in range(N + 1)]
        return prime
    prime = [True for i in range(N + 1)]
    prime[0] = False
    prime[1] = False
    for i in range(2, int(N**0.5) + 1):
        if prime[i]:
            for j in range(i * 2, N + 1, i):
                prime[j] = False
    return prime


n, p = list(map(int, input().split()))
if n > 50:
    print((1))
elif n == 1:
    print(p)
else:
    prime = Sieve_of_Eratosthenes(int(p ** (1 / n)))
    ans = 1
    for i in range(2, len(prime)):
        tmp = 0
        while p % i == 0:
            p //= i
            tmp += 1
        if tmp >= n:
            for _ in range(tmp // n):
                ans *= i
    print(ans)

def Sieve_of_Eratosthenes(N):
    if N < 2:
        prime = [False for i in range(N + 1)]
        return prime
    prime = [True for i in range(N + 1)]
    prime[0] = False
    prime[1] = False
    for i in range(2, int(N**0.5) + 1):
        if prime[i]:
            for j in range(i * 2, N + 1, i):
                prime[j] = False
    return prime


n, p = list(map(int, input().split()))
if n > 50:
    print((1))
elif n == 1:
    print(p)
else:
    prime = Sieve_of_Eratosthenes(int(p ** (1 / n)))
    ans = 1
    for i in range(2, len(prime)):
        if prime[i] == False:
            continue
        tmp = 0
        while p % i == 0:
            p //= i
            tmp += 1
        for _ in range(tmp // n):
            ans *= i
    print(ans)

+        if prime[i] == False: +            continue -        if tmp >= n: -            for _ in range(tmp // n): -                ans *= i +        for _ in range(tmp // n): +            ans *= i