Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
out=1
tm = int(pow(p, 1/n))
for i in range(2,tm+1):
    if i==2:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
    elif i==3:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
    elif i%2!=0 and i%3!=0:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
out=1
tm = int(pow(p, 1/n))
for i in range(2,tm+1):
    if i==2:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
    elif i==3:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
    elif i%2!=0 and i%3!=0:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
out=1
tm = int(pow(p, 1/n))
for i in range(2,tm+1):
    if i==2:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
            
    elif i%2==1:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
            
        if p < i**n:
            break
print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
out=1
tm = int(pow(p, 1/n))
for i in range(2,tm+1):
    while p%(i**n)==0:
        p = p//(i**n)
        out *= i
        
    if p < i**n:
        break
print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
out=1
tm = int(pow(p, 1/n))
for i in range(2,tm+1):
    while p%(i**n)==0:
        p = p//(i**n)
        out *= i
        
    if p < i**n:
        break
print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
out=1
for i in range(2,p+1):
    if i==2:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i

    elif i%2!=0:
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
            
        if p < i**n:
            break
print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

Buggy python submission (verdict: Runtime Error):
n, p = map(int, input().split())
out=1
for i in range(2,p+1):
    while p%(i**n)==0:
        p = p//(i**n)
        out *= i
        
    if p < i**n:
        break
print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
out=1
for i in range(2,p+1):
    while p%(i**n)==0:
        p = p//(i**n)
        out *= i
        
    if p < i**n:
        break
print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

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

for i in [2] + list(range(3,p+1,2)):
    while p%i==0:
        if i not in dic.keys():
            dic[i] = 0
        p = p// i
        dic[i] += 1
        
    if p==1:
        break

out=1
for i in dic.keys():
    if dic[i] >=n:
        out *= i**(dic[i]//n)

print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

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

for i in range(2,p+1):
    while p%i==0:
        if i not in dic.keys():
            dic[i] = 0
        p = p// i
        dic[i] += 1
        
    if p==1:
        break
        
out=1
for i in dic.keys():
    if dic[i] >=n:
        out *= i**(dic[i]//n)

print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

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

for i in range(2,p+1):
    while p%i==0:
        if i not in dic.keys():
            dic[i] = 0
        p = p// i
        dic[i] += 1
        
    if p==1:
        break
        
out=1
for i in dic.keys():
    if dic[i] >=n:
        out *= i**(dic[i]//n)

print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

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

for i in range(2,p+1):
    while p%i==0:
        if i not in dic.keys():
            dic[i] = 0
        p = p// i
        dic[i] += 1
        
    if p==1:
        break
        
out=1
for i in dic.keys():
    if dic[i] >=n:
        out *= i**(dic[i]//n)

print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

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

import math
s=0
R=int(p)

dic = {}

while s==0:
    for i in range(2,R+1):
        if p%i==0:
            if i not in dic.keys():
                dic[i] = 0
            p = p//i
            if p==1:
                s=1
            dic[i] += 1
            break
out=1
for i in dic.keys():
    if dic[i] >=n:
        out *= i**(dic[i]//n)

print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)

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

import math
s=0
R=int(p)

dic = {}

while s==0:
    for i in range(2,R+1):
        if p%i==0:
            if i not in dic.keys():
                dic[i] = 0
            p = p//i
            if p==1:
                s=1
            dic[i] += 1
            break
out=1
for i in dic.keys():
    if dic[i] >=n:
        out *= i**(dic[i]//n)

print(out)

Fixed submission:
n, p = map(int, input().split())

if n==1:
    print(p)
else:
    out=1
    tm = int(pow(p, 1/n))
    for i in range(2,tm+1):
        while p%(i**n)==0:
            p = p//(i**n)
            out *= i
        if p < i**n:
            break
    print(out)