n,p = map(int,input().split())
a = 2
c = 1
m = p**(1/n)
while a<=m:
    b = a**n
    if p%b == 0:
        c *= a
        p //= b
        if p == 1 or b>p:
            break
        while p%b == 0:
            c *= a
            p //= b
        a += 1
        if p == 1 or b>p:
            break
        if p%a ==0:
                p //= a
                while p%a ==0:
                    p //= a
    else:
        a += 1
print(c)