import collections

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

i = 2
factors = []
while i * i <= p:
    if p % i:
        i += 1
    else:
        p //= i
        factors.append(i)
if n > 1:
    factors.append(p)


c = collections.Counter(factors)

pr=1
for f1,f2 in c.items():
    if f2/n>=1:
        pr*=f1*int(f2/n)
        
print(pr)
