from collections import defaultdict



def factorize(N):

    p = 2

    PRIME = []

    while p * p <= N:

        if N % p == 0:

            N //= p

            PRIME.append(p)

        else:

            p += 1

    if N > 1:

        PRIME.append(N)

    return PRIME





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



prime = factorize(p)

cnt = defaultdict(int)

for i in prime:

    cnt[i] += 1

ans = 1

for j in cnt:

    if cnt[j] >= n:

        ans *= j**(cnt[j]//n)

print(ans)

from collections import defaultdict





def factorize(N):

    p = 2

    PRIME = defaultdict(int)

    while p * p <= N:

        if N % p == 0:

            N //= p

            PRIME[p] += 1

        else:

            p += 1

    if N > 1:

        PRIME[N] += 1

    return PRIME





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



prime = factorize(p)

ans = 1

for j in prime:

    if prime[j] >= n:

        ans *= j**(prime[j]//n)

print(ans)

from collections import defaultdict


def factorize(N):
    p = 2
    PRIME = []
    while p * p <= N:
        if N % p == 0:
            N //= p
            PRIME.append(p)
        else:
            p += 1
    if N > 1:
        PRIME.append(N)
    return PRIME


n, p = list(map(int, input().split()))
prime = factorize(p)
cnt = defaultdict(int)
for i in prime:
    cnt[i] += 1
ans = 1
for j in cnt:
    if cnt[j] >= n:
        ans *= j ** (cnt[j] // n)
print(ans)

from collections import defaultdict


def factorize(N):
    p = 2
    PRIME = defaultdict(int)
    while p * p <= N:
        if N % p == 0:
            N //= p
            PRIME[p] += 1
        else:
            p += 1
    if N > 1:
        PRIME[N] += 1
    return PRIME


n, p = list(map(int, input().split()))
prime = factorize(p)
ans = 1
for j in prime:
    if prime[j] >= n:
        ans *= j ** (prime[j] // n)
print(ans)

-    PRIME = [] +    PRIME = defaultdict(int) -            PRIME.append(p) +            PRIME[p] += 1 -        PRIME.append(N) +        PRIME[N] += 1 -cnt = defaultdict(int) -for i in prime: -    cnt[i] += 1 -for j in cnt: -    if cnt[j] >= n: -        ans *= j ** (cnt[j] // n) +for j in prime: +    if prime[j] >= n: +        ans *= j ** (prime[j] // n)