Buggy python submission (verdict: Runtime Error):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP=P,s=2):
    for i in range(s,lim+1):
        if newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP //= i
            s = i
            break
    
        if newP < i or i == lim+1:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
    my(N,newP,s)

my(N)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

Buggy python submission (verdict: Runtime Error):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP=P,s=2):
    for i in range(s,lim+1):
        if newP % i == 0:
            # print('ok')
            dic[i] = dic.get(i,0) + 1
            # print(dic)
            newP //= i
            s = i
            break
    
        if newP == 1 or i == lim+1:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
    my(N,newP,s)

my(N)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

p = (int(p) + 1)//2**N

dic = {}

def my(N,p,s=2):
    for i in range(s,p+1):
        if p % i == 0:
            # print('ok')
            dic[i] = dic.get(i,0) + 1
            # print(dic)
            p = p//i
            s = i
            break
    
    if p == 1:
        res = 1
        for j,k in dic.items():
            res *= j**(k//N)
        print(res)
        exit()
    else:
        my(N,p,s)

my(N,P)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

p = (int(p) + 1)//2

dic = {}

def my(N,p,s=2):
    for i in range(s,p+1):
        if p % i == 0:
            dic[i] = dic.get(i,0) + 1
            p = p//i
            s = i
            
            break
    
    if p == 1:
        res = 1
        for j,k in dic.items():
            res *= j**(k//N)
        print(res)
        exit()
    else:
        my(N,p,s)

my(N,P)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

p = int(p) + 1

dic = {}

def my(N,p,s=2):
    for i in range(s,p+1):
        if p % i == 0:
            # print('ok')
            dic[i] = dic.get(i,0) + 1
            # print(dic)
            p = p//i
            s = i
            if 2*i**N > P:
                p = 1
            break
    
    if p == 1:
        res = 1
        for j,k in dic.items():
            res *= j**(k//N)
        print(res)
        exit()
    else:
        my(N,p,s)

my(N,P)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

p = int(p) + 1

dic = {}

def my(N,p,s=2):
    for i in range(s,p+1):
        if p % i == 0:
            # print('ok')
            dic[i] = dic.get(i,0) + 1
            # print(dic)
            p = p//i
            s = i
            break
    
    if p == 1:
        res = 1
        for j,k in dic.items():
            res *= j**(k//N)
        print(res)
        exit()
    else:
        my(N,p,s)

my(N,P)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

p = int(p) + 1

dic = {}

def my(N,p):
    for i in range(2,p+1):
        if p % i == 0:
            # print('ok')
            dic[i] = dic.get(i,0) + 1
            # print(dic)
            break
    p = p//i
    if p == 1:
        res = 1
        for j,k in dic.items():
            res *= j**(k//N)
        print(res)
        exit()
    else:
        my(N,p)

my(N,P)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()


p = int(p) + 1

n = 1
for i in range(p,1,-1):
    if P % (i**N) == 0:
        n = i
        break
print(n)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

Buggy python submission (verdict: Time Limit Exceeded):
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()


p = int(p) + 1

n = 0
for i in range(1,p+1):
    if P % (i**N) == 0:
        n = i
print(n)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

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

p = int(P**(1/N)) + 1
n = 0
for i in range(1,p+1):
    if P % (i**N) == 0:
        n = i
print(n)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)

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

p = int(P**(1/N)) + 1
n = 0
for i in range(1,p+1):
    if P % (i**N) == 0:
        n = i
print(n)

Fixed submission:
N, P = map(int, input().split())
p = P**(1/N)
if p % 1 == 0:
    print(int(p))
    exit()

lim = int(p) + 1

dic = {}

def my(N,newP):
    for i in range(2,lim+1):
        while newP % i == 0:
            dic[i] = dic.get(i,0) + 1
            newP = newP // i
        if newP < i or i == lim:
            res = 1
            for j,k in dic.items():
                res *= j**(k//N)
            print(res)
            exit()
my(N,P)