n,p = map(int,input().split())
if n == 1:
    print(p)
    exit(0)
r = 1
ret = 1
while True:
    if r**n > p:
        break;
    if ((p % r**n) == 0):
        ret = max(ret, r);
    r += 1
print(ret)
