N, P = map(int, input().split())
Y = [i for i in range(1,int(P**(1/N))+1) if P % i == 0]
m = int(P**(1/N))
while True:
  if P % m == 0:
    x = m**N
    if P % x == 0 and P / x in Y:
      break
  m -= 1
print(m)