Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int,input().split())

def calc(n):
  num = {}
  e, i = 0, 2
  while n != 1:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)

Fixed submission:
N, P = map(int,input().split())

def calc(n):
  num = {}
  e, i = 0, 2
  while i**2 <= n:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int,input().split())

if(n == 1):
  print(p)
  exit()
elif(p == 1):
  print(1)
  exit()

num = {}
s, e, i = 0, 0, 2
while s == 0:
  while p%i == 0:
    p //= i
    e += 1
    if(p == 1):
      s = 1
  if(e > 0):
    num[i] = e
  i += 1
  e = 0
cnt = 1
for k, v in num.items():
  if(v >= n):
    cnt *= k ** (v//n)
print(cnt)

Fixed submission:
N, P = map(int,input().split())

def calc(n):
  num = {}
  e, i = 0, 2
  while i**2 <= n:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)

Buggy python submission (verdict: Runtime Error):
n, p = map(int,input().split())

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()

num = {}
s, e, i = 0, 0, 2
while s == 0:
  while p%i == 0:
    p //= i
    e += 1
    if(p == 1):
      s = 1
  if(e > 0):
    num[i] = e
  i += 1
  e = 0
cnt = 1
for k, v in num.items():
  if(v >= n):
    cnt *= k ** (v//n)
print(cnt)

Fixed submission:
N, P = map(int,input().split())

def calc(n):
  num = {}
  e, i = 0, 2
  while i**2 <= n:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int,input().split())
n, p = N, P

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()

num = {}
s = 0
e = 0
i = 2
while s == 0:
  while p%i == 0:
    p = int(p/i)
    e += 1
    if(p == 1):
      s = 1
  if(e > 0):
    num[i] = e
  i += 1
  e = 0
cnt = 1
for k, v in num.items():
  if(v >= n):
    cnt *= k ** (v//n)
print(cnt)

Fixed submission:
N, P = map(int,input().split())

def calc(n):
  num = {}
  e, i = 0, 2
  while i**2 <= n:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int,input().split())
n, p = N, P

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()

num = []
s = 0
while s == 0:
  for i in range(2,p+1):
    if(p%i == 0):
      p = int(p/i)
      if(p == 1):
        s = 1
      num.append(i)
      break
d = {}
cnt = 1
for i in num:
  d[i] = num.count(i)
for k, v in d.items():
  if(v >= n):
    cnt *= k ** (v//n)
print(cnt)

Fixed submission:
N, P = map(int,input().split())

def calc(n):
  num = {}
  e, i = 0, 2
  while i**2 <= n:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)