using System;
using System.Linq;
using System.Collections.Generic;

class P{

    static void Main(){
       List<long>Sosu=new List<long>{2};
       var s=Console.ReadLine().Split().Select(long.Parse).ToArray();
       if(s[0]==1){
           Console.WriteLine(s[1]);
           return;
       }
       long lim=1+(long)Math.Pow((double)s[1],0.5/s[0]);
       for(long i=3;i<=lim;i++){
           if(Sosu.All(x=>i%x!=0))Sosu.Add(i);
       }
       int Lsosu=Sosu.Count();
       long[] cd=Enumerable.Repeat(0L,Lsosu).ToArray();
       for(int i=0;i<Lsosu;i++){
           while(s[1]%Sosu[i]==0){
               s[1]/=Sosu[i];
               cd[i]++;
           }
       }
       long ans=1;
       for(int i=0;i<Lsosu;i++){
           ans*=(long)Math.Pow((double)Sosu[i],(double)(cd[i]/s[0]));
       }
       Console.WriteLine(ans);
    }
}