# -*- coding: utf-8 -*-


def main():
    """Function."""
    n, p = map(int, input().split())

    if n == 1:
        print(p)
    elif p == 1:
        print(1)
    else:
        x_val = int((p ** (1/n)) // 1) + 1
        for _ in range(x_val-1):
            if p % (x_val ** n) == 0:
                break
            else:
                x_val -= 1

        print(x_val)


if __name__ == "__main__":
    main()
