#p=int(input())

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

#al=list(map(int,input().split()))

#l=[list(map(int,input().split())) for i in range(n)]

#素因数分解した結果を2次元配列にして返す

def prime_factorize(n):

    n_origin=n+0

    primelist=[]

    a=2

    while a*a<=n_origin:

        if n%a!=0:

            a+=1

            continue

        ex=0

        while n%a==0:

            ex+=1

            n=n//a

        primelist.append([a,ex])

        a+=1

    if n!=1:

        primelist.append([n,1])

    return primelist

pfs=prime_factorize(p)

ans=1



for pf in pfs:

    p=pf[0];ex=pf[1]

    ans=ans*(p**(ex//n))

print(ans)

#n=int(input())

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

#l=list(map(int,input().split()))

#l=[list(map(int,input().split())) for i in range(n)]



def prime_factorize(n):

    n_origin=n+0

    primelist=[]

    a=2

    while a*a<=n_origin:

        if n%a!=0:

            a+=1

            continue

        ex=0

        while n%a==0:

            ex+=1

            n=n//a

        primelist.append([a,ex])

        a+=1

    if n!=1:

        primelist.append([n,1])

    return primelist



primelist=prime_factorize(p)

ans=1

for p,e in primelist:

    ans=ans*(p**(e//n))

print(ans)
# p=int(input())
n, p = list(map(int, input().split()))
# al=list(map(int,input().split()))
# l=[list(map(int,input().split())) for i in range(n)]
# 素因数分解した結果を2次元配列にして返す
def prime_factorize(n):
    n_origin = n + 0
    primelist = []
    a = 2
    while a * a <= n_origin:
        if n % a != 0:
            a += 1
            continue
        ex = 0
        while n % a == 0:
            ex += 1
            n = n // a
        primelist.append([a, ex])
        a += 1
    if n != 1:
        primelist.append([n, 1])
    return primelist


pfs = prime_factorize(p)
ans = 1
for pf in pfs:
    p = pf[0]
    ex = pf[1]
    ans = ans * (p ** (ex // n))
print(ans)

# n=int(input())
n, p = list(map(int, input().split()))
# l=list(map(int,input().split()))
# l=[list(map(int,input().split())) for i in range(n)]
def prime_factorize(n):
    n_origin = n + 0
    primelist = []
    a = 2
    while a * a <= n_origin:
        if n % a != 0:
            a += 1
            continue
        ex = 0
        while n % a == 0:
            ex += 1
            n = n // a
        primelist.append([a, ex])
        a += 1
    if n != 1:
        primelist.append([n, 1])
    return primelist


primelist = prime_factorize(p)
ans = 1
for p, e in primelist:
    ans = ans * (p ** (e // n))
print(ans)

-# p=int(input()) +# n=int(input()) -# al=list(map(int,input().split())) +# l=list(map(int,input().split())) -# 素因数分解した結果を2次元配列にして返す -pfs = prime_factorize(p) +primelist = prime_factorize(p) -for pf in pfs: -    p = pf[0] -    ex = pf[1] -    ans = ans * (p ** (ex // n)) +for p, e in primelist: +    ans = ans * (p ** (e // n))