n,p=map(int,input().split())
 
def C(N,P):
    if N == 1: return P
    a=P**(1/N)
 
    p = 2
    p_list={}
    
    while a >= p :
        while P % p == 0:
            P /= p
            if p in p_list:
                p_list[p]+=1
            else:
                p_list[p]=1
        p+=1
        
    res=1
    for b,c in p_list.items() :
        if c >= N : res *= b * int(c/N)
    return res
 
print(C(n,p))