Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

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

factor = prime_factors(P)

res_fac = factor[:N]
rem_fac = factor[N:]

index = 0
for i in rem_fac:
    if len(res_fac)-1 < index:
        index = 0
    res_fac[index] *= i
    index += 1

print(gcd_list(res_fac))

Fixed submission:
import traceback
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

class PrimeFractorization:
    def __init__(self):
        self.a = 2

    def decomposit_prime(self, n):
        res = []
        try:
            while n >= self.a * self.a:
                if n % self.a == 0:
                    res.append(self.a)
                    #print(self.a, "* ", end="")
                    n //= self.a
                else:
                    self.a += 1

            res.append(n)
            
            return res

        except Exception as e:
            raise

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

obj = PrimeFractorization()
factor = obj.decomposit_prime(P)

res_fac = factor[:N]
amari = factor[N:]

index = 0
for i in amari:
    if len(res_fac)-1 < index:
        index = 0
    res_fac[index] *= i
    index += 1

print(gcd_list(res_fac))

Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

root = int(P**(1/N))

while P % root != 0:
    root += 1

fac1 = root

fac_list = []

for i in range(N - 1):
    while P % fac1 != 0:
        if P > fac1:
            fac1 += 1
        else:
            fac -= 1
    P /= fac1
    fac_list.append(fac1)

fac_list.append(int(P))

#print(fac_list)

print(int(gcd_list(fac_list)))


Fixed submission:
import traceback
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

class PrimeFractorization:
    def __init__(self):
        self.a = 2

    def decomposit_prime(self, n):
        res = []
        try:
            while n >= self.a * self.a:
                if n % self.a == 0:
                    res.append(self.a)
                    #print(self.a, "* ", end="")
                    n //= self.a
                else:
                    self.a += 1

            res.append(n)
            
            return res

        except Exception as e:
            raise

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

obj = PrimeFractorization()
factor = obj.decomposit_prime(P)

res_fac = factor[:N]
amari = factor[N:]

index = 0
for i in amari:
    if len(res_fac)-1 < index:
        index = 0
    res_fac[index] *= i
    index += 1

print(gcd_list(res_fac))

Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

root = int(P**(1/N))

while P % root != 0:
    root += 1

fac1 = root

fac_list = [fac1]

for i in range(N - 1):
    while P % fac1 != 0:
        if P > fac1:
            fac1 += 1
        else:
            fac -= 1
    P /= fac1
    fac_list.append(fac1)

fac_list.append(int(P))

#print(fac_list)

print(int(gcd_list(fac_list)))


Fixed submission:
import traceback
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

class PrimeFractorization:
    def __init__(self):
        self.a = 2

    def decomposit_prime(self, n):
        res = []
        try:
            while n >= self.a * self.a:
                if n % self.a == 0:
                    res.append(self.a)
                    #print(self.a, "* ", end="")
                    n //= self.a
                else:
                    self.a += 1

            res.append(n)
            
            return res

        except Exception as e:
            raise

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

obj = PrimeFractorization()
factor = obj.decomposit_prime(P)

res_fac = factor[:N]
amari = factor[N:]

index = 0
for i in amari:
    if len(res_fac)-1 < index:
        index = 0
    res_fac[index] *= i
    index += 1

print(gcd_list(res_fac))