# encoding: utf-8
N, P = map(int, input().split())

ranks = [0] * 2
P_tmp = P
for p in range(2, P):
    if P_tmp % p > 0: ranks.append(0)
    else:
        for i_p in range(1, P):
            if P_tmp % (p ** (i_p + 1)) > 0: break
        ranks.append(i_p)
        P_tmp = P_tmp // (p ** i_p)
        if P_tmp < 2: break

ans = 1
for p, rank in enumerate(ranks):
    if p < 2: continue
    ans = ans * (p ** (rank // N))

print(ans)