import sys
from math import ceil
sys.setrecursionlimit(10**9)

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

start = ceil(P**(1/N))

for ans in range(start,-1,-1) :
    if not P % ans**N :
        break
print(ans)
