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

i=2
a=[]
ans=1
while(True):
    if(P%i==0):
        P=P//i
        a.append(i)
    else:
        break

i=3 
while(True):
    if(P%i==0):
        P=P//i
        a.append(i)
        c=1
    else:
        i+=2
        c=0

    if((P<i**N)&(c==0)):
        break

dct=collections.Counter(a)

li=dct.items()

for tt in li:
    if tt[1]>=N:
        ans*=tt[0]**(tt[1]//N)

print(ans)    

    

Fixed submission:
import collections

n,p=map(int,input().split())

a=[]
while p % 2 == 0:
  p //= 2
  a.append(2)
f = 3
while f * f <= p:
  if p % f == 0:
    a.append(f)
    p //= f
  else:
    f += 2
if p != 1:
  a.append(p)

dct=collections.Counter(a)

ans=1

li=dct.items()

for tt in li:
  if tt[1]//n>=1:
    ans*=tt[0]**(tt[1]//n)
print(ans)

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

i=2
c=0
ans=1
while(True):
    if(P%i==0):
        P=P//i
        c+=1
        if(c%N==0):
            ans*=i
    else:
        break
c=0
i=3 
while(True):
    if(P%i==0):
        P=P//i
        c+=1
        if(c%N==0):
            ans*=i
    else:
        i+=2
        c=0
    
    if((P<i**N)&(c==0)):
        break
print(ans)
    

    

Fixed submission:
import collections

n,p=map(int,input().split())

a=[]
while p % 2 == 0:
  p //= 2
  a.append(2)
f = 3
while f * f <= p:
  if p % f == 0:
    a.append(f)
    p //= f
  else:
    f += 2
if p != 1:
  a.append(p)

dct=collections.Counter(a)

ans=1

li=dct.items()

for tt in li:
  if tt[1]//n>=1:
    ans*=tt[0]**(tt[1]//n)
print(ans)

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

i = 2
c=0
ans=1
while(True):
    if(P%i==0):
        P=P//i
        c+=1
        if(c%N==0):
            ans*=i
    else:
        i+=1
        c=0
    
    if((P<i**N)&(c==0)):
        break
print(ans)
    

    

Fixed submission:
import collections

n,p=map(int,input().split())

a=[]
while p % 2 == 0:
  p //= 2
  a.append(2)
f = 3
while f * f <= p:
  if p % f == 0:
    a.append(f)
    p //= f
  else:
    f += 2
if p != 1:
  a.append(p)

dct=collections.Counter(a)

ans=1

li=dct.items()

for tt in li:
  if tt[1]//n>=1:
    ans*=tt[0]**(tt[1]//n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

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

q = deque()

i = 2
ans=1
while(True):
    if(P%(i**N)==0):
        q.append(i)
        P=P//(i**N)
        ans*=i
    else:
        i+=1
    if(P<i):
        break
print(ans)
    

Fixed submission:
import collections

n,p=map(int,input().split())

a=[]
while p % 2 == 0:
  p //= 2
  a.append(2)
f = 3
while f * f <= p:
  if p % f == 0:
    a.append(f)
    p //= f
  else:
    f += 2
if p != 1:
  a.append(p)

dct=collections.Counter(a)

ans=1

li=dct.items()

for tt in li:
  if tt[1]//n>=1:
    ans*=tt[0]**(tt[1]//n)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

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

q = deque()

i = 2
c=0
ans=1
while(True):
    if(P%i==0):
        q.append(i)
        P=P//i
        c+=1
        if(c%N==0):
            ans*=i
    else:
        i+=1
        c=0
    

    if(P<i):
        break
print(ans)
    

Fixed submission:
import collections

n,p=map(int,input().split())

a=[]
while p % 2 == 0:
  p //= 2
  a.append(2)
f = 3
while f * f <= p:
  if p % f == 0:
    a.append(f)
    p //= f
  else:
    f += 2
if p != 1:
  a.append(p)

dct=collections.Counter(a)

ans=1

li=dct.items()

for tt in li:
  if tt[1]//n>=1:
    ans*=tt[0]**(tt[1]//n)
print(ans)