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 b>p:
            break
        while p%b == 0:
            c *= a
            p //= b
        a += 1
        if b>p:
            break
    else:
        a += 1
        if b>p:
            break
print(c)