#!/mnt/c/Users/moiki/bash/env/bin/python
N,P = list(map(int, input().split()))
import math
primes = [2]
primax = int(10e3)
for i in range(2,primax):
    ok = True
    # for p in [p for p in primes if p <= int(math.sqrt(i))]:
    for p in primes:
        if i % p == 0:
            ok = False
            break
    if ok:
        primes.append(i)

def df(P, p):
    if P >= p:
        cnt = 0
        while P >= p and P % p == 0:
            P = int(P//p)
            cnt += 1
        return cnt
    else:
        raise "P , p error."

gc = []
for p in primes:
    if P % p == 0:
        cnt = df(P, p)
        P = int( P // int(p**cnt))
        gc.append([p, cnt])
        # P = int(P//p)
ans = 1
for g,cnt in gc:
    if cnt >= N:
        ans *= g**(cnt//N)

print(ans)
# print(primes)k
# print(gc)