import numpy as np

args = [int(i) for i in input().split()]
N = args[0]
P = args[1]

num = 1
i = 2

count = 0
while True:
    if P % i == 0:
        P /= i
        count += 1
    else:
        x = count // N
        num *= i**x
        break

i = 3
while i <= int(P ** (1/N)):
    count = 0
    while True:
        if P % i == 0:
            P /= i
            count += 1
        else:
            x = count // N
            num *= i**x
            i += 2
            break

print(num)
