#!/usr/bin/env python3

import sys



def main():

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

    ans = 1

    if N == 1:

        print(P)

        exit()

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

        count = 0

        tmp = P

        while tmp % i == 0:

            count += 1

            tmp = tmp // i

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

        P = P // i**count

    print(ans)



if __name__ == '__main__':

    main()

from collections import Counter

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



def prime_factorize(N):

    prime_list = []

    while N % 2 == 0:

        prime_list.append(2)

        N //= 2

    f = 3

    while f**2 <= N:

        if N % f == 0:

            prime_list.append(f)

            N //= f

        else:

            f += 2

    if N != 1:

        prime_list.append(N)

    return prime_list



res = prime_factorize(P)

l = list(Counter(res).items())

ans = 1

for l in list(Counter(res).items()):

    ans *= l[0]**(l[1]//N)

print(ans)
#!/usr/bin/env python3
import sys


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


if __name__ == "__main__":
    main()

from collections import Counter

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


def prime_factorize(N):
    prime_list = []
    while N % 2 == 0:
        prime_list.append(2)
        N //= 2
    f = 3
    while f**2 <= N:
        if N % f == 0:
            prime_list.append(f)
            N //= f
        else:
            f += 2
    if N != 1:
        prime_list.append(N)
    return prime_list


res = prime_factorize(P)
l = list(Counter(res).items())
ans = 1
for l in list(Counter(res).items()):
    ans *= l[0] ** (l[1] // N)
print(ans)

-#!/usr/bin/env python3 -import sys +from collections import Counter + +N, P = list(map(int, input().split())) -def main(): -    N, P = list(map(int, input().split())) -    ans = 1 -    if N == 1: -        print(P) -        exit() -    for i in range(2, int(P ** (1 / N) + 1)): -        count = 0 -        tmp = P -        while tmp % i == 0: -            count += 1 -            tmp = tmp // i -        ans *= i ** (count // N) -        P = P // i**count -    print(ans) +def prime_factorize(N): +    prime_list = [] +    while N % 2 == 0: +        prime_list.append(2) +        N //= 2 +    f = 3 +    while f**2 <= N: +        if N % f == 0: +            prime_list.append(f) +            N //= f +        else: +            f += 2 +    if N != 1: +        prime_list.append(N) +    return prime_list -if __name__ == "__main__": -    main() +res = prime_factorize(P) +l = list(Counter(res).items()) +ans = 1 +for l in list(Counter(res).items()): +    ans *= l[0] ** (l[1] // N) +print(ans)