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

def factoring(n,dict_count = {}):

    sup = math.floor(pow(n,1/2))

    n_new = n

    for i in range(2,sup + 1):

        if n % i == 0:

            n_new = n // i

            if i in dict_count:

                dict_count[i] += 1

            else:

                dict_count[i] = 1

            break

    if n == n_new:

        if n_new in dict_count:

            dict_count[n_new] += 1

        else:

            dict_count[n_new] = 1

        return sorted(list(dict_count.items()))

    return factoring(n_new,dict_count)

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

result = factoring(P)

ans = 1

for e in result:

  ans *= pow(e[0],e[1] // N)

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


def factoring(n, dict_count={}):
    sup = math.floor(pow(n, 1 / 2))
    n_new = n
    for i in range(2, sup + 1):
        if n % i == 0:
            n_new = n // i
            if i in dict_count:
                dict_count[i] += 1
            else:
                dict_count[i] = 1
            break
    if n == n_new:
        if n_new in dict_count:
            dict_count[n_new] += 1
        else:
            dict_count[n_new] = 1
        return sorted(list(dict_count.items()))
    return factoring(n_new, dict_count)


N, P = list(map(int, input().split()))
result = factoring(P)
ans = 1
for e in result:
    ans *= pow(e[0], e[1] // N)
print(ans)

+ +def factoring(n, dict_count={}): +    sup = math.floor(pow(n, 1 / 2)) +    n_new = n +    for i in range(2, sup + 1): +        if n % i == 0: +            n_new = n // i +            if i in dict_count: +                dict_count[i] += 1 +            else: +                dict_count[i] = 1 +            break +    if n == n_new: +        if n_new in dict_count: +            dict_count[n_new] += 1 +        else: +            dict_count[n_new] = 1 +        return sorted(list(dict_count.items())) +    return factoring(n_new, dict_count) + + -if N == 1: -    print(P) -    exit() +result = factoring(P) -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) +for e in result: +    ans *= pow(e[0], e[1] // N)