Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
m = int(p**(1/n)) + 1

for i in range(m, 0, -1):
    if p%(i**n) == 0:
        print(i)
        exit()

Fixed submission:
n, p = map(int, input().split())
l = []
ans = 1

for i in range(2, int(p**0.5) + 2):
    if p%i == 0:
        cnt = 0
        while p%i == 0:
            p /= i
            cnt += 1
        l.append([i, cnt])

if p != 1:
    l.append([p, 1])

for i, j in l:
    while j >= n:
        ans *= i
        j -= n

print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
m = int(p**(1/n)) + 10

for i in range(m, 0, -1):
    if p%(i**n) == 0:
        print(i)
        exit()

Fixed submission:
n, p = map(int, input().split())
l = []
ans = 1

for i in range(2, int(p**0.5) + 2):
    if p%i == 0:
        cnt = 0
        while p%i == 0:
            p /= i
            cnt += 1
        l.append([i, cnt])

if p != 1:
    l.append([p, 1])

for i, j in l:
    while j >= n:
        ans *= i
        j -= n

print(int(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n, p = map(int, input().split())
m = int(p**(1/n) + 10)

for i in range(1, m)[::-1]:
    if p%(i**n) == 0:
        print(i)
        exit()

Fixed submission:
n, p = map(int, input().split())
l = []
ans = 1

for i in range(2, int(p**0.5) + 2):
    if p%i == 0:
        cnt = 0
        while p%i == 0:
            p /= i
            cnt += 1
        l.append([i, cnt])

if p != 1:
    l.append([p, 1])

for i, j in l:
    while j >= n:
        ans *= i
        j -= n

print(int(ans))

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

for i in range(1, int(p**(1/n) + 10))[::-1]:
    if p%(i**n) == 0:
        print(i)
        exit()

Fixed submission:
n, p = map(int, input().split())
l = []
ans = 1

for i in range(2, int(p**0.5) + 2):
    if p%i == 0:
        cnt = 0
        while p%i == 0:
            p /= i
            cnt += 1
        l.append([i, cnt])

if p != 1:
    l.append([p, 1])

for i, j in l:
    while j >= n:
        ans *= i
        j -= n

print(int(ans))

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

for i in range(1, int(p**(1/n) + 10))[::-1]:
    if p%(i**n) == 0:
        print(i)
        exit()

Fixed submission:
n, p = map(int, input().split())
l = []
ans = 1

for i in range(2, int(p**0.5) + 2):
    if p%i == 0:
        cnt = 0
        while p%i == 0:
            p /= i
            cnt += 1
        l.append([i, cnt])

if p != 1:
    l.append([p, 1])

for i, j in l:
    while j >= n:
        ans *= i
        j -= n

print(int(ans))

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

for i in range(1, int(p**(1/n)) + 10):
    if p%(i**n)== 0:
        ans = i

print(ans)

Fixed submission:
n, p = map(int, input().split())
l = []
ans = 1

for i in range(2, int(p**0.5) + 2):
    if p%i == 0:
        cnt = 0
        while p%i == 0:
            p /= i
            cnt += 1
        l.append([i, cnt])

if p != 1:
    l.append([p, 1])

for i, j in l:
    while j >= n:
        ans *= i
        j -= n

print(int(ans))