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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  p = pow(i, N)
  while p <= P:
    if P % p == 0:
      P //= p
      d *= i
    else:
      i += 1
      p = pow(i, N)
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i**N <= P:
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i**N <= P:
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= pow(P, 1/N)+1:
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

d = 1
i = 2
if N == 1:
  d = P
else:
  while i-1 <= pow(P, 1/N):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

d = 1
i = 2
if N == 1:
  d = P
else:
  while i <= pow(P, 1/N)+1:
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

Buggy python submission (verdict: Time Limit Exceeded):
from math import ceil

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

d = 1
i = 2
if N == 1:
  d = P
else:
  while i <= ceil(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

def f(N, P):
  d = 1
  i = 2
  if N == 1:
    return P
  else:
    while i <= pow(P, 1/N)+1:
      if P % i**N == 0:
        P //= i**N
        d *= i
      else:
        i += 1
    return d

print(f(N, P))

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

d = 1
i = 2
while i <= pow(P, 1/N)+1:
  while True:
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      break
  i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

d = 1
i = 2
while i <= pow(P, 1/N)+1:
  if P % i**N == 0:
    P //= i**N
    d *= i
  else:
    i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

d = 1
i = 2
while i <= pow(P, 1/N)+1:
  if P % i**N == 0:
    P //= i**N
    d *= i
  else:
    i += 1
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

Buggy python submission (verdict: Time Limit Exceeded):
from math import ceil

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

d = ceil(pow(P, 1/N))
for i in range(ceil(pow(P, 1/N)), 0, -1):
  if P % i**N == 0:
    d = i
    break
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

d = int(pow(P, 1/N))
for i in range(int(pow(P, 1/N))+1, 0, -1):
  if P % i**N == 0:
    d = i
    break
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

d = int(pow(P, 1/N))+1
for i in range(int(pow(P, 1/N))+1, 0, -1):
  if P % i**N == 0:
    d = i
    break
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

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

d = int(pow(P, 1/N))
for i in range(int(pow(P, 1/N))+1, 0, -1):
  if P % i**N == 0:
    d = i
    break
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)

Buggy python submission (verdict: Time Limit Exceeded):
from math import ceil

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

d = 1
for i in range(1, ceil(pow(P, 1/N))+1):
  if P % i**N == 0:
    d = i
print(d)

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

if N == 1:
  d = P
else:
  d = 1
  i = 2
  while i <= round(pow(P, 1/N)):
    if P % i**N == 0:
      P //= i**N
      d *= i
    else:
      i += 1
print(d)