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

div = 2
res = 1
while div * div <= P:
    cnt = 0
    tmp = P
    while P % div == 0:
        tmp /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

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

div = 2
res = 1
while P != 1 and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

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

div = 2
res = 1
while P != 1:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

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

res = 1
i = 2

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

while True:
    if i > P ** (1 / N) + 1:
        break
    if P % pow(i, N) == 0:
        res = i

    i += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

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

res = 1
i = 1

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

while True:
    t = np.power(i, N)

    if t > P:
        break
    if P % t == 0:
        res = i

    i += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

Buggy python submission (verdict: Runtime Error):
import numpy as np

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

res = 1
i = 1

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

while True:
    t = np.power(i, N)

    if t > P:
        break
    if P % t == 0:
        res = i

    i += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

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

res = 1
i = 1

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

while i ** N <= P:
    if P % i ** N == 0:
        res = i

    i += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

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

res = 1
i = 1

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

while i ** N <= P:
    if P % i ** N == 0:
        res = i

    i += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

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

res = 1
i = 1

while i ** N <= P:
    if P % i ** N == 0:
        res = i

    i += 1

print(res)


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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
ret = 1
k = 0
r = 2

while P != 1:
    if P % r == 0:
        k += 1
        P /= r
        if k == N:
            ret *= r
            k = 0
    else:
        k = 0
        if r == 2:
            r += 1
        else:
            r += 2

print(ret)

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

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

div = 2
res = 1
R = P

while div * div <= R and div <= P:
    cnt = 0
    while P % div == 0:
        P /= div
        cnt += 1

        if cnt == N:
            res *= div
            cnt = 0
    div += 1

print(res)