import math

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

if N == 1:
    print(P)
else:
    now_max = 1
    
    for i in range(int(math.pow(P, 1 / N)) + 1, 0, -1):
        if P % (i ** N) == 0:
            now_max = i
            break
    
    print(now_max)