Buggy python submission (verdict: Runtime Error):
import math
N, P = map(int, input().split())
p = math.ceil(P**(1/N))
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)


for i in reversed(range(1,p+1)):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)


Fixed submission:
import math
N, P = map(int, input().split())
p = P**(1/N)
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)


divisors=[]

for i in range(2,round(P**(1/N))+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N, P = map(int, input().split())
p = math.ceil(P**(1/N))
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)

divisors=[]
for i in range(1,p+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)


Fixed submission:
import math
N, P = map(int, input().split())
p = P**(1/N)
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)


divisors=[]

for i in range(2,round(P**(1/N))+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N, P = map(int, input().split())
p = math.ceil(P**(1/N))
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)

divisors=[]
for i in range(1,p+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)


Fixed submission:
import math
N, P = map(int, input().split())
p = P**(1/N)
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)


divisors=[]

for i in range(2,round(P**(1/N))+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N, P = map(int, input().split())
p = math.ceil(P**(1/N))
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)

if P%2==1:
  flag=True
for i in reversed(range(1, p+1)):
    if flag and i%2==0:
      continue
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)


Fixed submission:
import math
N, P = map(int, input().split())
p = P**(1/N)
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)


divisors=[]

for i in range(2,round(P**(1/N))+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N, P = map(int, input().split())
p = math.ceil(P**(1/N))
ans = 1
flag=False
if P%2==1:
  flag=True
for i in reversed(range(1, p+1)):
    if flag and i%2==0:
      continue
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)


Fixed submission:
import math
N, P = map(int, input().split())
p = P**(1/N)
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)


divisors=[]

for i in range(2,round(P**(1/N))+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
N, P = map(int, input().split())
p = math.ceil(P**(1/N))
ans = 1
for i in reversed(range(1, p+1)):

    if P % (i ** N) == 0:
        ans = i
        break
print(ans)


Fixed submission:
import math
N, P = map(int, input().split())
p = P**(1/N)
ans = 1
flag=False
if N==1:
  print(P)
  exit(0)


divisors=[]

for i in range(2,round(P**(1/N))+1):
  if P%i==0:
    divisors.append(i)
for i in reversed(divisors):
    if P % (i ** N) == 0:
        ans = i
        break
print(ans)