n,p = (int(i) for i in input().split())
prime=[]
def prime_judge(p):
    isPrime=True
    for i in range(1,int(p**(1/2))+1):
        if p%i==0 and i!=1:
            isPrime = False
            break
    return isPrime

if p>1:
    for i in range(2,int(p**(1/2))):
        if prime_judge(i):
            prime.append(i)

    i=0
    factor={}
    while(i<len(prime) and p>1):
        divided = False
        if p%prime[i]==0:
            p/=prime[i]
            divided = True
            if(prime[i] in factor.keys()):
                factor[prime[i]] += 1
            else:
                factor[prime[i]] = 1
        if not divided:
            i += 1

    sum = 1
    for i,x in factor.items():
        if x>=n:
            sum *= i**(int(x/n))
    print(int(sum))
else:
    print(1)