program main
implicit None
	integer(8)::n,p,q,i
	
	read *,n,p
	q = int(real(p)**(1.0/real(n)))+1
	
	do i =  q,1,-1
		if(mod(p,i**n) == 0)then
			print 101,i
			stop
		endif
	enddo
	
	101 format(i0)
end program main