def read():
    N, P = list(map(int, input().strip().split()))
    return N, P


def solve(N, P):
    for v in range(1000, 1, -1):
        if P % (v**N) == 0:
            return v
    return 1


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))
