import sys

input = sys.stdin.readline



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

if N == 1:

  print(P)

  exit(0)

i = 2

x = P + 0

l = []

s = set()

while i * i <= P:

  while x % i == 0:

    x //= i

    l.append(i)

    s.add(i)

  i += 1

if x >= 2:

  l.append(x)

  s.add(x)

#print(l)

res = 1

for y in s:

  t = l.count(y)

  if t >= N:

    res *= pow(y, (t // N))

print(res)
import sys

from collections import Counter

input = sys.stdin.readline

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

c = Counter()

x = 2

while x * x <= P:

  while P % x == 0:

    P //= x

    c[x] += 1

  x += 1

if P > 1: c[P] += 1

#print(c)

res = 1

for k in list(c.keys()):

  v = c[k]

  res *= pow(k, v // N)

print(res)
import sys

input = sys.stdin.readline
N, P = list(map(int, input().split()))
if N == 1:
    print(P)
    exit(0)
i = 2
x = P + 0
l = []
s = set()
while i * i <= P:
    while x % i == 0:
        x //= i
        l.append(i)
        s.add(i)
    i += 1
if x >= 2:
    l.append(x)
    s.add(x)
# print(l)
res = 1
for y in s:
    t = l.count(y)
    if t >= N:
        res *= pow(y, (t // N))
print(res)

import sys
from collections import Counter

input = sys.stdin.readline
N, P = list(map(int, input().split()))
c = Counter()
x = 2
while x * x <= P:
    while P % x == 0:
        P //= x
        c[x] += 1
    x += 1
if P > 1:
    c[P] += 1
# print(c)
res = 1
for k in list(c.keys()):
    v = c[k]
    res *= pow(k, v // N)
print(res)

+from collections import Counter -if N == 1: -    print(P) -    exit(0) -i = 2 -x = P + 0 -l = [] -s = set() -while i * i <= P: -    while x % i == 0: -        x //= i -        l.append(i) -        s.add(i) -    i += 1 -if x >= 2: -    l.append(x) -    s.add(x) -# print(l) +c = Counter() +x = 2 +while x * x <= P: +    while P % x == 0: +        P //= x +        c[x] += 1 +    x += 1 +if P > 1: +    c[P] += 1 +# print(c) -for y in s: -    t = l.count(y) -    if t >= N: -        res *= pow(y, (t // N)) +for k in list(c.keys()): +    v = c[k] +    res *= pow(k, v // N)