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



from collections import defaultdict

d = defaultdict(int)

i = 2

while P >= i*i:

    if P%i==0:

        P //= i

        d[i] += 1

    # elif i == 2:

    #     i += 1

    else:

        i += 1

        # i += 2

if P != 1:

    d[P] += 1



ans = 1

for k, v in list(d.items()):

    # print(k, v)

    z = v // N

    ans *= k**z

print(ans)

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



from collections import defaultdict

d = defaultdict(int)

i = 2

while P >= i*i:

    if P%i==0:

        P //= i

        d[i] += 1

    elif i == 2:

        i += 1

    else:

        i += 2

if P != 1:

    d[P] += 1



ans = 1

for k, v in list(d.items()):

    # print(k, v)

    if v >= N:

        ans *= k**(v//N)

    # z = v // N

    # ans *= k**z

print(ans)

N, P = list(map(int, input().split()))
from collections import defaultdict

d = defaultdict(int)
i = 2
while P >= i * i:
    if P % i == 0:
        P //= i
        d[i] += 1
    # elif i == 2:
    #     i += 1
    else:
        i += 1
        # i += 2
if P != 1:
    d[P] += 1
ans = 1
for k, v in list(d.items()):
    # print(k, v)
    z = v // N
    ans *= k**z
print(ans)

N, P = list(map(int, input().split()))
from collections import defaultdict

d = defaultdict(int)
i = 2
while P >= i * i:
    if P % i == 0:
        P //= i
        d[i] += 1
    elif i == 2:
        i += 1
    else:
        i += 2
if P != 1:
    d[P] += 1
ans = 1
for k, v in list(d.items()):
    # print(k, v)
    if v >= N:
        ans *= k ** (v // N)
    # z = v // N
    # ans *= k**z
print(ans)

-    # elif i == 2: -    #     i += 1 +    elif i == 2: +        i += 1 -        i += 1 -        # i += 2 +        i += 2 -    z = v // N -    ans *= k**z +    if v >= N: +        ans *= k ** (v // N) +    # z = v // N +    # ans *= k**z