def main():
	buf = input().split()
	n = int(buf[0])
	p = int(buf[1])
	r = 1
	max = p
	i = 2
	while(p >= max):
		#print(p, i)
		max = i**n
		if(p % i**n == 0):
				p //= i**n
				r *= i
		else:
			i += 1
 
	print(r)	
main()