def get_gcd(N, P):
    if N == 1:
        return P
    lst = []
    flg = True
    while flg:
        flg = False
        for i in range(2, P+1):
            if P < i ** N:
                break
            if P % (i ** N) == 0:
                lst.append(i)
                P //= (i ** N)
                flg = True
                break
    ans = 1
    for i in lst:
        ans *= i
    return ans

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