using System;
using System.Collections.Generic;
using System.Linq;
public class Hello{
    public static void Main(){
        var input = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        var n = input[0];
        var p = input[1];
        
        long ans = 1;
        for(var i = 2;i <= p;i++){
            if(p % (long)Math.Pow(i,n) == 0){
                ans = i;
            }
        }
        Console.WriteLine(ans);
        
    }
}
