N, P = gets.split(/ /).collect{|n| n.to_i}

if N == 1
	puts P
else
	
	MAX = 10 ** 6
	
	p_table = [true] * (MAX + 1)
	
	(2..10**6).each{|n|
		next unless p_table[n]
		x = n + n
		while x < MAX
			p_table[x] = false
			x += n
		end
	#	print "#{n} "
	}
	p_list = []
	
	(2..10**6).each{|n|
		if p_table[n]
			p_list << n
		end
	}
	
	i = p_list.length - 1
	
	f_table = {}
	
	num = P
	while i >= 0 && num > 1
		f = p_list[i]
		if f <= num
			while true
				if num % f == 0
					num = num / f
					if count = f_table[f]
						f_table[f] = count + 1
					else
						f_table[f] = 1
					end
				else
					break
				end
			end
		end
		
		i -= 1
	end
	
	answer = 1
	f_table.each{|f, count|
		if count >= N
			answer *= (f ** (count / N))
		end
	}
	
	puts answer
end
