N, P = map(int, input().split())

li = [1]
if N ==1:
    li.append(P)
else:
    for i in range(1,int(P**(1/N))+3):
        X = i**N
        if X > P:
            break
        else:
            if P % X == 0:
                li.append(i)
            else: pass

print(max(li))