n, p = map(int, input().split())
if n == 1 or p== 1:
    print(p)
    exit()
c2 = 0
while p%2 == 0:
    c2 += 1
    p//=2
c = 2**(c2//n)
max = 1
i = 1
while i**n <= p:
    i *= 2
s = i//2
t = i
while s < t:
    i = int((s+2)/2)
    if c**n <= p:
        t = i
    else:
        s = i
while i > 1:
    if p%(i**n) == 0:
        print(c*i)
        exit()
    else:
        i -= 1
print(c)