#pragma warning disable

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
using System.Numerics;
using System.Collections;
using System.Timers;

static class MainClass
{
    public static void Main(string[] args)
    {

        var NP = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList();
        var N = NP[0];
        var P = NP[1];
        var ls = PrimeFactorize(P);
        
        var dic = new Dictionary<long, long>();
        if (N == 1)
        {
            Console.WriteLine(P);
            return;
        }
        else
        {
            foreach (var item in ls)
            {
                if (dic.ContainsKey(item))
                {
                    dic[item]++;
                }
                else
                {
                    dic.Add(item, 1);
                }
            }
            long max = 1l;
            foreach (var item in dic)
            {
                if (item.Value >= N)
                {
                    max *= item.Key;
                }
            }
            var count = 2;
            BigInteger max2 = 1;
            if (false)
            {
                //while (true)
                //{
                //    try
                //    {
                //        checked
                //        {
                //            var pows = Math.Pow(count, (int)N);
                //            if (pows > P)
                //            {
                //                break;
                //            }
                //            if (P % (long)pows == 0)
                //            {
                //                max2 = count;
                //            }
                //        }
                //    }
                //    catch (Exception)
                //    {
                //        break;

                //    }
                //    count++;
                //}
            }
            else
            {
                while (true)
                {
                    if (N >= int.MaxValue)
                    {
                        break;
                    }
                    var pows = BigInteger.Pow(count, (int)N);
                    if (pows > P)
                    {
                        break;
                    }
                    if (P % pows == 0)
                    {
                        max2 = count;
                    }
                    count++;
                }
            }
            Console.WriteLine(max2);
            Console.ReadLine();

        }

    }

    // 素因数分解
    public static List<long> PrimeFactorize(long n)
    {
        var bases = n;
        var num = (long)Math.Pow(n, 0.5);
        var ls = new List<long>();
        for (int i = 2; i <= num; i++)
        {
            if (n % i == 0)
            {
                n = n / i;
                ls.Add(i);
                i--;
                continue;
            }
        }
        long nnn = 1;
        foreach (var item in ls)
        {
            nnn = nnn * item;
        }
        if (nnn != bases)
            ls.Add(n);
        return ls;
    }
    
    
    #region ライブラリ
    public static long ToInt64(this string str) => long.Parse(str);
    public static int ToInt32(this string str) => int.Parse(str);
    public static BigInteger ToBigInteger(this string str) => BigInteger.Parse(str);
    public static List<string> SplittedStringToList(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
    public static List<int> SplittedStringToInt32List(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToList();
    public static List<BigInteger> SplittedStringToBigInteger(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => BigInteger.Parse(x)).ToList();
    #endregion
}


Measured memory_bytes: 15712