N,P = map(int,input().split())
i = round(P**(1/N))
j = 2
res = 1
if N == 1:
  print(P)
  exit()
elif P == 1|N>=40:
  print(1)
  exit()
else:
  while P%(j**N)==0:
    P = P//(j**N)
    res *= j
  j += 1
  if N >= 26:
    print(res)
    exit()
  for f in range(j,i+1,2):
    while P%(f**N) == 0:
      P = P//(f**N)
      res *= f
      
  print(res)
  exit()