using System;
using System.Collections.Generic;

namespace Main
{
    class Program
    {
        static void Main(string[] args)
        {
            var NP = Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
            long N = NP[0], P = NP[1];

            long max = (long)Math.Ceiling(Math.Pow(P, 1 / (double)N));
            long ans = 1;
            for(long i = max; i >= 1; i--)
            {
                if (N % i != 0)
                    continue;
                long tmpans = 1;
                for (int j = 0; j < N; j++)
                    tmpans *= i;
                if (P % tmpans == 0)
                {
                    ans = i;
                    break;
                }
            }

            Console.WriteLine(ans);
        }
    }
}
