def sieveOfEratosthenes(N, s): 
    prime = [False] * (N+1) 
    for i in range(2, N+1, 2):  
        s[i] = 2
    for i in range(3, N+1, 2): 
        if (prime[i] == False):  
            s[i] = i 
            for j in range(i, int(N / i) + 1, 2): 
                if (prime[i*j] == False): 
                    prime[i*j] = True
                    s[i * j] = i 
  
def generatePrimeFactors(N): 
    s = [0] * (N+1) 
  
    sieveOfEratosthenes(N, s) 
    curr = s[N] 
    cnt = 1 
    factordict = dict()
    while (N > 1): 
        N //= s[N] 
        if (curr == s[N]): 
            cnt += 1
            continue
        factordict[curr] = cnt
        curr = s[N] 
        cnt = 1
    return factordict

#print(generatePrimeFactors(28))
n, p = [int(i) for i in input().split()]
factordict = generatePrimeFactors(p)
ans = 1
for i in factordict:
    ans *= i **(factordict[i]//n)
print(ans)