import math
N, P = (int(i) for i in input().split())
a = 1
b = math.floor(math.sqrt(P))
i = 2
c = P

if N ==1:
    a = P
if N =2 and P = 1000000000000:
    a = 1000000
else:
    while (i**N <= P) and (i<=b):
        if c % (i**N) == 0:
            a = i
        i = i+1

print(a)
